mirror of
https://github.com/zeldaret/tmc
synced 2026-09-01 09:52:51 -04:00
Merge branch 'master' into demo-jp
This commit is contained in:
+2
-2
@@ -94,12 +94,12 @@ void (*const gEnemyFunctions[])(Entity* ent) = {
|
||||
[MINI_SLIME] = MiniSlime,
|
||||
[FIREBALL_GUY] = FireballGuy,
|
||||
[MINI_FIREBALL_GUY] = MiniFireballGuy,
|
||||
[ENEMY_5A] = Enemy5A,
|
||||
[VAATI_TRANSFIGURED_EYE] = VaatiTransfiguredEye,
|
||||
[BUSINESS_SCRUB_PROLOGUE] = BusinessScrubPrologue,
|
||||
[GYORG_FEMALE] = GyorgFemale,
|
||||
[GYORG_MALE] = GyorgMale,
|
||||
[CURTAIN] = Curtain,
|
||||
[ENEMY_5F] = Enemy5F,
|
||||
[VAATI_WRATH_EYE] = VaatiWrathEye,
|
||||
[GYORG_CHILD] = GyorgChild,
|
||||
[GYORG_FEMALE_EYE] = GyorgFemaleEye,
|
||||
[ENEMY_62] = Enemy62,
|
||||
|
||||
@@ -138,7 +138,7 @@ void sub_08028A74(Entity* this) {
|
||||
unk = 1;
|
||||
sub_080290FC(this);
|
||||
if (this->frames.all & 1) {
|
||||
Entity* ent = sub_0804A98C(this, 4, 0);
|
||||
Entity* ent = CreateProjectileWithParent(this, 4, 0);
|
||||
if (ent != NULL) {
|
||||
ent->parent = this;
|
||||
ent->direction = this->direction;
|
||||
|
||||
+5
-5
@@ -224,7 +224,7 @@ void sub_08020F48(Entity* this) {
|
||||
|
||||
this->action = 14;
|
||||
sub_08021218(this, 13, uVar2 >> 3);
|
||||
pEVar3 = sub_0804A98C(this, 0, 1);
|
||||
pEVar3 = CreateProjectileWithParent(this, 0, 1);
|
||||
if (pEVar3) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
@@ -270,7 +270,7 @@ void sub_08021010(Entity* this) {
|
||||
|
||||
void sub_08021038(Entity* this) {
|
||||
if (this->attachedEntity == NULL && this->frames.all) {
|
||||
Entity* pEVar2 = (Entity*)sub_0804A98C(this, 0, 0);
|
||||
Entity* pEVar2 = (Entity*)CreateProjectileWithParent(this, 0, 0);
|
||||
if (pEVar2) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
@@ -309,7 +309,7 @@ void sub_080210E4(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->frames.all &= ~1;
|
||||
ent = sub_0804A98C(this, 0, 2);
|
||||
ent = CreateProjectileWithParent(this, 0, 2);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
@@ -569,7 +569,7 @@ void sub_0802159C(Entity* this) {
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
ent = sub_0804A98C(this, 0, 3);
|
||||
ent = CreateProjectileWithParent(this, 0, 3);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
@@ -590,7 +590,7 @@ void sub_08021600(Entity* this) {
|
||||
|
||||
this->frames.all = 0;
|
||||
this->damageType = 0x51;
|
||||
ent = sub_0804A98C(this, 0, 4);
|
||||
ent = CreateProjectileWithParent(this, 0, 4);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
this->attachedEntity = ent;
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ void sub_0803EB44(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
|
||||
sub_0804A720(this);
|
||||
pEVar1 = sub_0804A98C(this, 0x19, 0);
|
||||
pEVar1 = CreateProjectileWithParent(this, 0x19, 0);
|
||||
if (pEVar1 != NULL) {
|
||||
pEVar1->parent = this;
|
||||
this->attachedEntity = pEVar1;
|
||||
|
||||
@@ -109,7 +109,7 @@ void GyorgMale(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08046898(Entity* this) {
|
||||
Entity* tmp = sub_080A7EE0(0x22);
|
||||
Entity* tmp = CreateProjectile(0x22);
|
||||
u32 tmp2;
|
||||
if (!tmp)
|
||||
return;
|
||||
@@ -402,7 +402,7 @@ void sub_08046EF4(Entity* this) {
|
||||
if ((--this->field_0xf & 0xFF) == 0) {
|
||||
Entity* tmp;
|
||||
this->field_0xf = (Random() & 0x38) + 0x78;
|
||||
tmp = sub_080A7EE0(0x23);
|
||||
tmp = CreateProjectile(0x23);
|
||||
if (tmp) {
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->parent = this;
|
||||
@@ -426,7 +426,7 @@ void sub_08046F64(Entity* this) {
|
||||
if (--this->field_0x7c.HALF.HI == 0) {
|
||||
Entity* tmp;
|
||||
this->field_0x7c.HALF.HI = 0x78;
|
||||
tmp = sub_080A7EE0(0x23);
|
||||
tmp = CreateProjectile(0x23);
|
||||
if (tmp) {
|
||||
tmp->collisionLayer = 2;
|
||||
tmp->parent = this;
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ void sub_08032794(Entity* this) {
|
||||
void sub_080327C8(Entity* this) {
|
||||
Entity* child;
|
||||
|
||||
child = sub_0804A98C(this, 11, 0);
|
||||
child = CreateProjectileWithParent(this, 11, 0);
|
||||
if (child != NULL) {
|
||||
child->parent = this;
|
||||
this->attachedEntity = child;
|
||||
|
||||
+2
-2
@@ -117,7 +117,7 @@ void sub_0803C86C(Entity* this) {
|
||||
}
|
||||
|
||||
void Lakitu_Initialize(Entity* this) {
|
||||
Entity* cloud = sub_0804A98C(this, 17, 0);
|
||||
Entity* cloud = CreateProjectileWithParent(this, 17, 0);
|
||||
if (cloud == NULL) {
|
||||
return;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ void Lakitu_SpawnLightning(Entity* this) {
|
||||
Entity* lightning;
|
||||
const OffsetCoords* offset;
|
||||
|
||||
lightning = sub_0804A98C(this, 18, 0);
|
||||
lightning = CreateProjectileWithParent(this, 18, 0);
|
||||
|
||||
if (lightning == NULL) {
|
||||
return;
|
||||
|
||||
@@ -779,7 +779,7 @@ NONMATCH("asm/non_matching/mazaal/sub_08034B38.inc", void sub_08034B38(Entity* t
|
||||
this->action = 3;
|
||||
InitializeAnimation(this, this->type + 3);
|
||||
} else {
|
||||
target = sub_080A7EE0(0xe);
|
||||
target = CreateProjectile(0xe);
|
||||
if (target != NULL) {
|
||||
target->type -= 2;
|
||||
if (target->type == 0) {
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ void Octorok_Move(Entity* this) {
|
||||
void Octorok_ShootNut(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->frames.all & 1) {
|
||||
Entity* ent = sub_0804A98C(this, 1, 0);
|
||||
Entity* ent = CreateProjectileWithParent(this, 1, 0);
|
||||
if (ent) {
|
||||
const s8* off;
|
||||
ent->direction = this->direction;
|
||||
|
||||
+3
-3
@@ -170,7 +170,7 @@ void sub_080240B8(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
this->attachedEntity = ent;
|
||||
ent->parent = this;
|
||||
@@ -413,7 +413,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->height.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
@@ -436,7 +436,7 @@ void sub_080244E8(Entity* this) {
|
||||
this->height.HALF.HI -= 0xe;
|
||||
this->field_0x78.HWORD -= 0xe;
|
||||
|
||||
ent = sub_0804A98C(this, 6, this->field_0x82.HALF.HI);
|
||||
ent = CreateProjectileWithParent(this, 6, this->field_0x82.HALF.HI);
|
||||
if (ent) {
|
||||
ent->parent = this;
|
||||
ent->height.HALF.HI += 0xe;
|
||||
|
||||
@@ -94,7 +94,7 @@ void sub_08028314(Entity* this) {
|
||||
sub_08028604(this);
|
||||
}
|
||||
|
||||
pEVar2 = sub_080A7EE0(3);
|
||||
pEVar2 = CreateProjectile(3);
|
||||
if (pEVar2 != NULL) {
|
||||
pEVar2->parent = this;
|
||||
this->attachedEntity = pEVar2;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -185,7 +185,7 @@ void sub_08044868(Entity* this) {
|
||||
if (*(u8*)&vaati->field_0x86 > 1) {
|
||||
u8 draw = this->spriteSettings.b.draw;
|
||||
if (draw == 1 && this->cutsceneBeh.HALF.LO == 0) {
|
||||
vaati = sub_0804A98C(this, 0x18, 0);
|
||||
vaati = CreateProjectileWithParent(this, 0x18, 0);
|
||||
if (vaati) {
|
||||
vaati->type2 = 1;
|
||||
vaati->parent = this;
|
||||
@@ -275,7 +275,7 @@ void sub_080449F8(Entity* this) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
draw = this->spriteSettings.b.draw;
|
||||
if (draw) {
|
||||
vaati = sub_0804A98C(this, 0x1c, 0);
|
||||
vaati = CreateProjectileWithParent(this, 0x1c, 0);
|
||||
if (vaati) {
|
||||
vaati->y.HALF.HI += 4;
|
||||
vaati->parent = this;
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
#include "global.h"
|
||||
#include "enemy.h"
|
||||
#include "audio.h"
|
||||
#include "random.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern s16 gUnk_080B4488[];
|
||||
|
||||
void VaatiEyesMacroFunction0(Entity*);
|
||||
void VaatiEyesMacroFunction1(Entity*);
|
||||
void VaatiEyesMacroFunction0Type0(Entity*);
|
||||
void VaatiEyesMacroFunction0Type1(Entity*);
|
||||
void VaatiEyesMacroFunction0Type2(Entity*);
|
||||
void VaatiEyesMacroFunction0Type3(Entity*);
|
||||
void VaatiEyesMacroFunction0Type0Action0(Entity*);
|
||||
void VaatiEyesMacroFunction0Type0Action1(Entity*);
|
||||
void VaatiEyesMacroFunction0Type1Action0(Entity*);
|
||||
void VaatiEyesMacroFunction0Type1Action1(Entity*);
|
||||
void sub_0802EF90(Entity*);
|
||||
void sub_0802EFB8(Entity*);
|
||||
void sub_0802EF58(Entity*);
|
||||
void sub_0802F04C(Entity*);
|
||||
|
||||
void (*const vaatiEyesMacroFunctions[])(Entity*) = {
|
||||
VaatiEyesMacroFunction0, VaatiEyesMacroFunction1, sub_08001324, sub_0804A7D4, sub_08001242, VaatiEyesMacroFunction0,
|
||||
};
|
||||
void (*const vaatiEyesMacroFunction0Types[])(Entity*) = {
|
||||
VaatiEyesMacroFunction0Type0,
|
||||
VaatiEyesMacroFunction0Type1,
|
||||
VaatiEyesMacroFunction0Type2,
|
||||
VaatiEyesMacroFunction0Type3,
|
||||
};
|
||||
void (*const vaatiEyesMacroFunction0Type0Actions[])(Entity*) = {
|
||||
VaatiEyesMacroFunction0Type0Action0,
|
||||
VaatiEyesMacroFunction0Type0Action1,
|
||||
};
|
||||
void (*const vaatiEyesMacroFunction0Type1Actions[])(Entity*) = {
|
||||
VaatiEyesMacroFunction0Type1Action0,
|
||||
VaatiEyesMacroFunction0Type1Action1,
|
||||
};
|
||||
const u8 gUnk_080CDE6C[] = { 0, 8, 0x18, 0 };
|
||||
const u8 gUnk_080CDE70[] = {
|
||||
9, 9, 8, 9, 8, 8, 8, 7, 7, 7, 6, 7, 6, 6, 6, 5, 5, 5, 12, 5, 12, 12, 12, 11, 11, 11, 10, 11, 10, 10, 10, 9,
|
||||
};
|
||||
const s8 gUnk_080CDE90[] = { -2, -3, -4, -5, -6, -5, -4, -3 };
|
||||
const u16 gUnk_080CDE98[] = { 0xc0, 0x100, 0x140, 0x180 };
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
void VaatiEyesMacro(Entity* this) {
|
||||
vaatiEyesMacroFunctions[GetNextFunction(this)](this);
|
||||
SetChildOffset(this, 0, 1, -0x10);
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0(Entity* this) {
|
||||
vaatiEyesMacroFunction0Types[this->type](this);
|
||||
if (this->type < 2) {
|
||||
sub_0802EF90(this);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction1(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
if (this->currentHealth == 0) {
|
||||
gScreenTransition.field_0x39 &= ~(1 << (gScreenTransition.field_0x3c + 2));
|
||||
}
|
||||
if (gRoomControls.roomID == 0) {
|
||||
gScreenTransition.field_0x3a = this->currentHealth;
|
||||
} else {
|
||||
gScreenTransition.field_0x3b = this->currentHealth;
|
||||
}
|
||||
if (this->field_0x78.HALF.HI != this->currentHealth) {
|
||||
EnqueueSFX(SFX_17A);
|
||||
}
|
||||
this->field_0x78.HALF.HI = this->currentHealth;
|
||||
} else {
|
||||
if (this->type == 1) {
|
||||
if (0 < this->iframes) {
|
||||
this->iframes *= -1;
|
||||
}
|
||||
if (this->currentHealth != 0xff) {
|
||||
EnqueueSFX(SFX_BUTTON_DEPRESS);
|
||||
}
|
||||
this->currentHealth = 0xff;
|
||||
}
|
||||
}
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
}
|
||||
sub_0804AA30(this, vaatiEyesMacroFunctions);
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type0(Entity* this) {
|
||||
vaatiEyesMacroFunction0Type0Actions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type0Action0(Entity* this) {
|
||||
Manager* manager;
|
||||
Entity* enemy;
|
||||
|
||||
if ((gEntCount < 0x47) && (manager = GetEmptyManager(), manager != NULL)) {
|
||||
manager->type = 9;
|
||||
manager->subtype = 0x34;
|
||||
manager->parent = (Manager*)this;
|
||||
AppendEntityToList((Entity*)manager, 8);
|
||||
enemy = CreateEnemy(VAATI_EYES_MACRO, 2);
|
||||
enemy->parent = this;
|
||||
this->action = 1;
|
||||
if (gRoomControls.roomID == 0) {
|
||||
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3a;
|
||||
} else {
|
||||
this->field_0x78.HALF.HI = this->currentHealth = gScreenTransition.field_0x3b;
|
||||
}
|
||||
this->field_0x78.HALF.LO = Random();
|
||||
sub_0802EFB8(this);
|
||||
InitializeAnimation(this, 0);
|
||||
sub_0802EF58(this);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type0Action1(Entity* this) {
|
||||
sub_0802F04C(this);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type1(Entity* this) {
|
||||
vaatiEyesMacroFunction0Type1Actions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type1Action0(Entity* this) {
|
||||
Entity* entity;
|
||||
u32 rand;
|
||||
|
||||
if (gEntCount < 0x47) {
|
||||
entity = CreateEnemy(VAATI_EYES_MACRO, 3);
|
||||
entity->parent = this;
|
||||
this->action = 1;
|
||||
rand = Random();
|
||||
this->actionDelay = (rand & 3) + 1;
|
||||
this->field_0x78.HALF.LO = Random() >> 8;
|
||||
this->direction = gUnk_080CDE6C[rand >> 0x10 & 3];
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type1Action1(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = 0;
|
||||
} else {
|
||||
sub_0802F04C(this);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct xy {
|
||||
u8 x;
|
||||
u8 y;
|
||||
} xy;
|
||||
|
||||
void VaatiEyesMacroFunction0Type2(Entity* this) {
|
||||
u32 uVar2;
|
||||
xy* temp;
|
||||
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->animationState = 0xff;
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
uVar2 = (GetFacingDirection(this, &gPlayerEntity) + 1) & 0x1e;
|
||||
temp = (xy*)&gUnk_080CDE70[uVar2];
|
||||
if (temp->x != this->frameIndex) {
|
||||
if (temp->y != this->frameIndex) {
|
||||
this->frameIndex = temp->x;
|
||||
}
|
||||
}
|
||||
this->y.HALF.HI++;
|
||||
this->spriteOffsetY -= 1;
|
||||
}
|
||||
|
||||
void VaatiEyesMacroFunction0Type3(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->frameIndex = 0x11;
|
||||
this->spritePriority.b0 = 6;
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
this->height.HALF.HI = 0;
|
||||
}
|
||||
|
||||
void sub_0802EF58(Entity* this) {
|
||||
Entity* entity;
|
||||
u32 i;
|
||||
|
||||
for (i = 0; i < 7; i++) {
|
||||
entity = CreateEnemy(VAATI_EYES_MACRO, 1);
|
||||
if (entity != NULL) {
|
||||
entity->type2 = i;
|
||||
entity->collisionLayer = 1;
|
||||
entity->parent = this;
|
||||
UpdateSpriteForCollisionLayer(entity);
|
||||
CopyPosition(this, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802EF90(Entity* this) {
|
||||
this->height.HALF.HI = gUnk_080CDE90[this->field_0x78.HALF.LO++ >> 3 & 7];
|
||||
}
|
||||
|
||||
void sub_0802EFB8(Entity* this) {
|
||||
u32 uVar1;
|
||||
u32 rand;
|
||||
u32 uVar3;
|
||||
int iVar4;
|
||||
|
||||
rand = Random();
|
||||
if ((rand >> 0x10 & 3) != 0) {
|
||||
uVar1 = rand & 0x18;
|
||||
} else {
|
||||
uVar3 = GetFacingDirection(&gPlayerEntity, this);
|
||||
uVar1 = (uVar3 + 4) & 0x18;
|
||||
}
|
||||
iVar4 = sub_080002E0(TILE(this->x.HALF.HI, this->y.HALF.HI) + gUnk_080B4488[((uVar1) >> 3)], 1);
|
||||
if (iVar4 != 0) {
|
||||
this->direction = 0xff;
|
||||
} else {
|
||||
this->actionDelay = (rand & 3) + 1;
|
||||
this->direction = (uVar1 & 0x18);
|
||||
this->speed = gUnk_080CDE98[rand >> 0x18 & 3];
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0802F04C(Entity* this) {
|
||||
s32 oldX;
|
||||
s32 oldY;
|
||||
|
||||
oldX = this->x.HALF.HI;
|
||||
oldY = this->y.HALF.HI;
|
||||
if (ProcessMovement(this) == 0) {
|
||||
sub_0802EFB8(this);
|
||||
return;
|
||||
}
|
||||
switch (this->direction >> 3) {
|
||||
case 0:
|
||||
if (((oldY & 0xf) > 8) && ((this->y.HALF.HI & 0xf) < 9)) {
|
||||
this->actionDelay--;
|
||||
oldY = (this->y.HALF.HI & 0xfff0) + 8;
|
||||
}
|
||||
if (this->actionDelay == 0) {
|
||||
this->x.HALF.HI = oldX;
|
||||
this->y.HALF.HI = oldY;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (((oldX & 0xf) < 8) && ((this->x.HALF.HI & 0xf) >= 8)) {
|
||||
this->actionDelay--;
|
||||
oldX = (this->x.HALF.HI & 0xfff0) + 8;
|
||||
}
|
||||
if (this->actionDelay == 0) {
|
||||
this->x.HALF.HI = oldX;
|
||||
this->y.HALF.HI = oldY;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (((oldY & 0xf) < 8) && ((this->y.HALF.HI & 0xf) >= 8)) {
|
||||
this->actionDelay--;
|
||||
oldY = (this->y.HALF.HI & 0xfff0) + 8;
|
||||
}
|
||||
if (this->actionDelay == 0) {
|
||||
this->x.HALF.HI = oldX;
|
||||
this->y.HALF.HI = oldY;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (((oldX & 0xf) >= 9) && ((this->x.HALF.HI & 0xf) < 9)) {
|
||||
this->actionDelay--;
|
||||
oldX = (this->x.HALF.HI & 0xfff0) + 8;
|
||||
}
|
||||
if (this->actionDelay == 0) {
|
||||
this->x.HALF.HI = oldX;
|
||||
this->y.HALF.HI = oldY;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
sub_0802EFB8(this);
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
#include "global.h"
|
||||
#include "enemy.h"
|
||||
#include "random.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern bool32 PlayerInRange(Entity*, u32, u32);
|
||||
extern void DoExitTransition(ScreenTransitionData*);
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
extern Entity* gUnk_020000B0;
|
||||
extern const ScreenTransitionData gUnk_0813AB94;
|
||||
|
||||
bool32 sub_0803E4A0(Entity*);
|
||||
void VaatiProjectileFunction0(Entity*);
|
||||
void VaatiProjectileFunction1(Entity*);
|
||||
void sub_08001328(Entity*);
|
||||
void VaatiProjectileFunction3(Entity*);
|
||||
void VaatiProjectileNoop(Entity*);
|
||||
void VaatiProjectileFunction0Action0(Entity*);
|
||||
void VaatiProjectileFunction0Action1(Entity*);
|
||||
void VaatiProjectileFunction0Action2(Entity*);
|
||||
void VaatiProjectileFunction0Action3(Entity*);
|
||||
void VaatiProjectileFunction0Action4(Entity*);
|
||||
void VaatiProjectileFunction0Action5(Entity*);
|
||||
void VaatiProjectileFunction0Action6(Entity*);
|
||||
void VaatiProjectileFunction0Action7(Entity*);
|
||||
void VaatiProjectileFunction0Action8(Entity*);
|
||||
void VaatiProjectileFunction0Action9(Entity*);
|
||||
void sub_0803E444(Entity*);
|
||||
void sub_0803E480(Entity*);
|
||||
void sub_0803E4D8(Entity*);
|
||||
|
||||
void (*const vaatiProjectileFunctions[])(Entity*) = {
|
||||
VaatiProjectileFunction0, VaatiProjectileFunction1, sub_08001328, VaatiProjectileFunction3, sub_08001242,
|
||||
VaatiProjectileNoop,
|
||||
};
|
||||
void (*const vaatiProjectileFunction0Actions[])(Entity*) = {
|
||||
VaatiProjectileFunction0Action0, VaatiProjectileFunction0Action1, VaatiProjectileFunction0Action2,
|
||||
VaatiProjectileFunction0Action3, VaatiProjectileFunction0Action4, VaatiProjectileFunction0Action5,
|
||||
VaatiProjectileFunction0Action6, VaatiProjectileFunction0Action7, VaatiProjectileFunction0Action8,
|
||||
VaatiProjectileFunction0Action9,
|
||||
};
|
||||
|
||||
void VaatiProjectile(Entity* this) {
|
||||
if (sub_0803E4A0(this)) {
|
||||
this->flags &= 0x7f;
|
||||
this->currentHealth = 0;
|
||||
this->parent = NULL;
|
||||
}
|
||||
vaatiProjectileFunctions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0(Entity* this) {
|
||||
vaatiProjectileFunction0Actions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction1(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (this->bitfield == 0x80) {
|
||||
#ifndef EU
|
||||
if (this->currentHealth != 0) {
|
||||
#endif
|
||||
this->action = 5;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->spritePriority.b1 = 0;
|
||||
gPlayerEntity.flags &= 0x7f;
|
||||
gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY;
|
||||
gPlayerEntity.spriteRendering.b3 = this->spriteRendering.b3;
|
||||
sub_0803E444(this);
|
||||
#ifndef EU
|
||||
sub_08078A90(2);
|
||||
entity = this->parent;
|
||||
if (entity != NULL) {
|
||||
entity->flags = entity->flags & 0x7f;
|
||||
}
|
||||
} else {
|
||||
gPlayerState.flags.all &= 0xfffffeff; // using b.unk8 does not match
|
||||
entity = &gPlayerEntity;
|
||||
entity->flags = gPlayerEntity.flags | 0x80;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
sub_0804AA30(this, vaatiProjectileFunctions);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction3(Entity* this) {
|
||||
if (this->parent != NULL) {
|
||||
this->parent->field_0xf--;
|
||||
this->parent = NULL;
|
||||
}
|
||||
sub_0804A7D4(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileNoop(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action0(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (this->type == 0) {
|
||||
entity = CreateEnemy(VAATI_PROJECTILE, 1);
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
this->attachedEntity = entity;
|
||||
if (this->type2 == 0) {
|
||||
this->action = 1;
|
||||
this->height.HALF.HI = -0x18;
|
||||
} else {
|
||||
this->action = 9;
|
||||
this->height.HALF.HI = -0x80;
|
||||
this->flags2 = 1;
|
||||
}
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
} else {
|
||||
this->action = 8;
|
||||
this->flags = this->flags & 0x7f;
|
||||
this->spriteOffsetY = 1;
|
||||
this->spriteOrientation.flipY = this->parent->spriteOrientation.flipY;
|
||||
this->spriteRendering.b3 = this->parent->spriteRendering.b3;
|
||||
this->spritePriority.b1 = 0;
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action1(Entity* this) {
|
||||
sub_0803E480(this);
|
||||
if (PlayerInRange(this, 0, 8) != 0) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 10;
|
||||
InitializeAnimation(this->attachedEntity, 2);
|
||||
} else {
|
||||
if (gUnk_020000B0 != NULL) {
|
||||
sub_08004596(this, GetFacingDirection(this, gUnk_020000B0));
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action2(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (++this->height.HALF.HI == 0) {
|
||||
this->action = 3;
|
||||
}
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action3(Entity* this) {
|
||||
if ((this->attachedEntity->frames.b.f3) != 0) {
|
||||
if (--this->height.HALF.HI <= -0x18) {
|
||||
this->action = 4;
|
||||
this->actionDelay = (Random() & 0xf) + 0xf;
|
||||
InitializeAnimation(this->attachedEntity, 1);
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action4(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 1;
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action5(Entity* this) {
|
||||
sub_0803E444(this);
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
if (-0x18 < --this->height.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
this->action = 6;
|
||||
this->actionDelay = 0x14;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action6(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 7;
|
||||
this->direction = 0x10;
|
||||
this->speed = 0x300;
|
||||
}
|
||||
sub_0803E444(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action7(Entity* this) {
|
||||
sub_0803E444(this);
|
||||
sub_0806F69C(this);
|
||||
sub_0803E4D8(this);
|
||||
if ((gRoomControls.roomOriginY + gRoomControls.height + -0x10) <= this->y.HALF.HI) {
|
||||
sub_0805E5A8();
|
||||
DoExitTransition((ScreenTransitionData*)&gUnk_0813AB94);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action8(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void VaatiProjectileFunction0Action9(Entity* this) {
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI;
|
||||
if (this->height.HALF.HI < -8) {
|
||||
if (this->animIndex != 2) {
|
||||
this->actionDelay = 0;
|
||||
InitializeAnimation(this->attachedEntity, 2);
|
||||
}
|
||||
VaatiProjectileFunction0Action2(this);
|
||||
} else {
|
||||
this->height.HALF.HI += 8;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803E444(Entity* this) {
|
||||
ResetPlayer();
|
||||
gPlayerState.field_0x1a[0] = gPlayerState.field_0x1a[0] | 0x80;
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
|
||||
sub_0806FA90(this, this->field_0x4c, 0, -2);
|
||||
gPlayerEntity.spriteOffsetY += 0xe;
|
||||
}
|
||||
|
||||
void sub_0803E480(Entity* this) {
|
||||
if (this->field_0x78.HWORD >= 0x4b1) {
|
||||
this->speed = 0x180;
|
||||
} else {
|
||||
this->field_0x78.HWORD++;
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_0803E4A0(Entity* this) {
|
||||
#ifdef EU
|
||||
bool32 ret;
|
||||
if (gScreenTransition.field_0x39 == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
if (this->parent == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
ret = this->parent->next == NULL;
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
bool32 ret;
|
||||
if (gScreenTransition.field_0x39 != 0) {
|
||||
if (this->parent == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
if (this->parent->currentHealth == 0) {
|
||||
return TRUE;
|
||||
} else {
|
||||
ret = this->parent->next == NULL;
|
||||
}
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sub_0803E4D8(Entity* this) {
|
||||
u32 tile;
|
||||
|
||||
tile = TILE(this->x.HALF.HI, this->y.HALF.HI + 8);
|
||||
if (sub_080002E0(tile, gPlayerEntity.collisionLayer) != 0xff) {
|
||||
SetTile(0x4074, tile, gPlayerEntity.collisionLayer);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,902 @@
|
||||
#include "global.h"
|
||||
#include "enemy.h"
|
||||
#include "coord.h"
|
||||
#include "flags.h"
|
||||
#include "random.h"
|
||||
#include "audio.h"
|
||||
#include "area.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_080AEFB4(Entity*);
|
||||
extern u8 gEntCount;
|
||||
|
||||
void VaatiRebornEnemyType0PreAction(Entity*);
|
||||
void VaatiRebornEnemyType1PreAction(Entity*);
|
||||
void VaatiRebornEnemyType0Action0(Entity*);
|
||||
void VaatiRebornEnemyType0Action1(Entity*);
|
||||
void VaatiRebornEnemyType0Action2(Entity*);
|
||||
void VaatiRebornEnemyType0Action3(Entity*);
|
||||
void VaatiRebornEnemyType0Action4(Entity*);
|
||||
void VaatiRebornEnemyType0Action5(Entity*);
|
||||
void VaatiRebornEnemyType0Action6(Entity*);
|
||||
void VaatiRebornEnemyType0Action7(Entity*);
|
||||
void VaatiRebornEnemyType1Action0(Entity*);
|
||||
void VaatiRebornEnemyType1Action1(Entity*);
|
||||
void VaatiRebornEnemyType2Action0(Entity*);
|
||||
void VaatiRebornEnemyType2Action1(Entity*);
|
||||
void VaatiRebornEnemyType3Action0(Entity*);
|
||||
void VaatiRebornEnemyType3Action1(Entity*);
|
||||
void sub_0803DD78(Entity*);
|
||||
u32 sub_0803DEE0(Entity*);
|
||||
u32 sub_0803E028(Entity*);
|
||||
void sub_0803DC0C(Entity*);
|
||||
|
||||
typedef struct xy {
|
||||
s8 x;
|
||||
s8 y;
|
||||
} PACKED xy;
|
||||
|
||||
void (*const vaatiRebornEnemyType0Actions[])(Entity*) = {
|
||||
VaatiRebornEnemyType0Action0, VaatiRebornEnemyType0Action1, VaatiRebornEnemyType0Action2,
|
||||
VaatiRebornEnemyType0Action3, VaatiRebornEnemyType0Action4, VaatiRebornEnemyType0Action5,
|
||||
VaatiRebornEnemyType0Action6, VaatiRebornEnemyType0Action7,
|
||||
};
|
||||
void (*const vaatiRebornEnemyType1Actions[])(Entity*) = {
|
||||
VaatiRebornEnemyType1Action0,
|
||||
VaatiRebornEnemyType1Action1,
|
||||
};
|
||||
void (*const vaatiRebornEnemyType2Actions[])(Entity*) = {
|
||||
VaatiRebornEnemyType2Action0,
|
||||
VaatiRebornEnemyType2Action1,
|
||||
};
|
||||
void (*const vaatiRebornEnemyType3Actions[])(Entity*) = {
|
||||
VaatiRebornEnemyType3Action0,
|
||||
VaatiRebornEnemyType3Action1,
|
||||
};
|
||||
|
||||
const xy gUnk_080D04A8[] = { { 16, -43 }, { -16, -43 } };
|
||||
const Coords gUnk_080D04AC[] = { { .HALF = { 0x58, 0x60 } },
|
||||
{ .HALF = { 0x58, 0x90 } },
|
||||
{ .HALF = { 0x98, 0x78 } },
|
||||
{ .HALF = { 0xd8, 0x60 } },
|
||||
{ .HALF = { 0xd8, 0x90 } } };
|
||||
const u8 gUnk_080D04C0[] = { 2, 0, 0, 2, 2, 2, 4, 4 };
|
||||
const xy gUnk_080D04C8[] = { { 10, -29 }, { -10, -29 }, { 15, -21 }, { -15, -21 } };
|
||||
#ifdef EU
|
||||
const u8 gUnk_080D04D0[] = { -12, -20, -32 };
|
||||
#else
|
||||
const u8 gUnk_080D04D0[] = { -24, -40, -48 };
|
||||
#endif
|
||||
const u8 gUnk_080D04D3[] = { 0, 1, 0, -1 };
|
||||
|
||||
void VaatiRebornEnemy(Entity* this) {
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
VaatiRebornEnemyType0PreAction(this);
|
||||
vaatiRebornEnemyType0Actions[this->action](this);
|
||||
break;
|
||||
case 1:
|
||||
VaatiRebornEnemyType1PreAction(this);
|
||||
vaatiRebornEnemyType1Actions[this->action](this);
|
||||
break;
|
||||
case 2:
|
||||
vaatiRebornEnemyType2Actions[this->action](this);
|
||||
break;
|
||||
case 3:
|
||||
vaatiRebornEnemyType3Actions[this->action](this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action0(Entity* this) {
|
||||
s32 i;
|
||||
Entity* entity;
|
||||
const xy* ptr;
|
||||
|
||||
if (CheckLocalFlag(0x7b) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_0804A720(this);
|
||||
if (CheckRoomFlag(0) && (gEntCount < 0x42)) {
|
||||
ClearRoomFlag(0);
|
||||
this->action = 3;
|
||||
this->field_0x74.HALF.LO = -1;
|
||||
this->actionDelay = 0;
|
||||
this->field_0x76.HALF.LO = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->direction = 0xff;
|
||||
this->spritePriority.b0 = 4;
|
||||
this->height.WORD = 0;
|
||||
this->field_0x80.HALF.LO = 2;
|
||||
this->field_0x86.HALF.LO = 0;
|
||||
this->cutsceneBeh.HALF.HI = 0x30;
|
||||
this->cutsceneBeh.HALF.LO = -1;
|
||||
this->field_0x86.HALF.HI = 0;
|
||||
this->field_0x82.HALF.LO = 0;
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
*(u32*)(&this->field_0x78) = this->x.WORD;
|
||||
this->field_0x7c = this->y;
|
||||
entity = CreateEnemy(VAATI_REBORN_ENEMY, 1);
|
||||
entity->parent = this;
|
||||
this->attachedEntity = entity;
|
||||
for (i = 0; i < 6; i++) {
|
||||
entity = CreateEnemy(VAATI_BALL, 0);
|
||||
entity->parent = this;
|
||||
entity->field_0x78.HALF.HI = i;
|
||||
}
|
||||
for (i = 0; i < 4; i++) {
|
||||
entity = CreateEnemy(VAATI_REBORN_ENEMY, 3);
|
||||
entity->parent = this;
|
||||
entity->actionDelay = i;
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
entity = CreateEnemy(VAATI_BALL, 1);
|
||||
entity->parent = this;
|
||||
entity->spriteSettings.b.flipX = i;
|
||||
ptr = &gUnk_080D04A8[i];
|
||||
PositionRelative(this, entity, ptr->x << 0x10, ptr->y << 0x10);
|
||||
}
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action1(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
if ((this->field_0x74.HALF.LO & 0x70) == 0) {
|
||||
if (this->attachedEntity->actionDelay == 0) {
|
||||
sub_0803DD78(this);
|
||||
if (this->field_0x74.HALF.HI != 0) {
|
||||
this->action = 2;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0x10;
|
||||
this->direction = 0xff;
|
||||
} else {
|
||||
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
|
||||
this->direction = ((Random() & 0x80) >> 3) | 8;
|
||||
} else {
|
||||
this->direction = 0xff;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->actionDelay = 2;
|
||||
}
|
||||
} else {
|
||||
this->action = 3;
|
||||
this->field_0x74.HALF.HI = this->field_0x74.HALF.LO & 0x80;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0xc0;
|
||||
this->direction = 0xff;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (--this->field_0x76.HALF.HI == 0) {
|
||||
switch (sub_0803DEE0(this)) {
|
||||
case 0:
|
||||
this->action = 4;
|
||||
this->actionDelay = 0xa0;
|
||||
this->direction = 0xff;
|
||||
this->cutsceneBeh.HALF.LO = 0xff;
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
break;
|
||||
case 1:
|
||||
this->action = 6;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0;
|
||||
this->direction = 0xff;
|
||||
break;
|
||||
case 3:
|
||||
this->action = 5;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->field_0xf = 0x20;
|
||||
this->direction = 0xff;
|
||||
break;
|
||||
case 2:
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0x20;
|
||||
if ((this->field_0x86.HALF.LO != 0) || (this->field_0x80.HALF.LO != 0)) {
|
||||
this->direction = ((Random() & 0x80) >> 3) | 8;
|
||||
} else {
|
||||
this->direction = 0xff;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (this->attachedEntity->actionDelay == 0) {
|
||||
this->cutsceneBeh.HALF.HI++;
|
||||
if ((this->cutsceneBeh.HALF.HI & 3) == 0) {
|
||||
switch (this->cutsceneBeh.HALF.HI & 0x30) {
|
||||
case 0:
|
||||
case 0x30:
|
||||
this->y.HALF.HI++;
|
||||
break;
|
||||
case 0x10:
|
||||
case 0x20:
|
||||
this->y.HALF.HI--;
|
||||
}
|
||||
}
|
||||
sub_080AEFB4(this);
|
||||
}
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action2(Entity* this) {
|
||||
const Coords* ptr;
|
||||
|
||||
switch (this->field_0x74.HALF.LO) {
|
||||
case 0:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
this->actionDelay = 0x20;
|
||||
InitAnimationForceUpdate(this, 3);
|
||||
SoundReq(SFX_19B);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->field_0x74.HALF.LO = 2;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->actionDelay = 0x10;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
if (sub_0803E028(this) == 0) {
|
||||
s32 tmp;
|
||||
this->field_0x80.HALF.HI += 1 + (Random() & 3);
|
||||
tmp = this->field_0x80.HALF.HI;
|
||||
this->field_0x80.HALF.HI = tmp % 5;
|
||||
ptr = &gUnk_080D04AC[this->field_0x80.HALF.HI];
|
||||
this->x.HALF.HI = gRoomControls.roomOriginX + ptr->HALF.x + 0x10;
|
||||
this->y.HALF.HI = gRoomControls.roomOriginY + ptr->HALF.y + 0x10;
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->actionDelay = 0x20;
|
||||
InitAnimationForceUpdate(this, 4);
|
||||
SoundReq(SFX_F5);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
if (4 < this->field_0x80.HALF.HI) {
|
||||
this->x.HALF.HI = gPlayerEntity.x.HALF.HI;
|
||||
this->y.HALF.HI = gPlayerEntity.y.HALF.HI - 0x18;
|
||||
}
|
||||
if (--this->field_0x76.HALF.HI == 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 1;
|
||||
} else {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 0x10;
|
||||
}
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action3(Entity* this) {
|
||||
u8 temp;
|
||||
|
||||
switch (this->field_0x74.HALF.LO) {
|
||||
case 0xfe:
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 1;
|
||||
break;
|
||||
case 0xff:
|
||||
if (this->height.HALF.HI != -4) {
|
||||
this->height.WORD -= 0x2000;
|
||||
}
|
||||
if (this->actionDelay == 2) {
|
||||
this->field_0x74.HALF.LO = 0xfe;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
if ((this->field_0x74.HALF.HI & 0x80) != 0) {
|
||||
temp = 0x14;
|
||||
} else {
|
||||
temp = 0x20;
|
||||
}
|
||||
this->actionDelay = temp;
|
||||
this->field_0x80.HALF.LO = ((this->field_0x86.HALF.LO + 1) >> 1) * 2 + 2;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
if ((this->field_0x74.HALF.HI & 0x80) == 0) {
|
||||
SoundReq(SFX_1B0);
|
||||
}
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->field_0x74.HALF.LO = 3;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 1;
|
||||
break;
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action4(Entity* this) {
|
||||
u32 index;
|
||||
Entity* entity;
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 1;
|
||||
this->cutsceneBeh.HALF.LO = 0xff;
|
||||
this->actionDelay = 1;
|
||||
this->direction = (this->direction + 0x10) & 0x1f;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
} else {
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->frames.all &= 0xef;
|
||||
if (this->cutsceneBeh.HALF.LO == 0xff) {
|
||||
index = Direction8RoundUp(GetFacingDirection(this, &gPlayerEntity));
|
||||
this->cutsceneBeh.HALF.LO = gUnk_080D04C0[index >> 2];
|
||||
this->field_0xf = 0;
|
||||
}
|
||||
if ((this->field_0xf < 0x10) &&
|
||||
(entity = CreateProjectileWithParent(this, 0x1a, this->cutsceneBeh.HALF.LO), entity != NULL)) {
|
||||
entity->field_0xf = this->field_0xf;
|
||||
entity->parent = this;
|
||||
entity->height.HALF.HI = this->height.HALF.HI;
|
||||
this->field_0xf = this->field_0xf + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action5(Entity* this) {
|
||||
u32 uVar3;
|
||||
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 1;
|
||||
this->direction = 0xff;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->field_0x74.HALF.LO) {
|
||||
case 0:
|
||||
if (--this->field_0xf == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
InitAnimationForceUpdate(this, 1);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->field_0x74.HALF.LO = 2;
|
||||
this->field_0xf = (Random() & 0x3f) + 0x40;
|
||||
SoundReq(SFX_SUMMON);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (--this->field_0xf == 0) {
|
||||
if (!((this->field_0x86.HALF.LO < 2) || (3 < this->field_0x86.HALF.HI)) && (Random() & 0x10) != 0) {
|
||||
this->field_0x86.HALF.HI++;
|
||||
this->field_0xf = (Random() & 0x3f) + 0x40;
|
||||
uVar3 = GetFacingDirection(this, &gPlayerEntity);
|
||||
this->direction = (uVar3 & 0x10) | 8;
|
||||
} else {
|
||||
this->field_0x74.HALF.LO++;
|
||||
this->field_0x86.HALF.HI = 0;
|
||||
this->field_0xf = 0x30;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (--this->field_0xf == 0) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 1;
|
||||
this->direction = 0xff;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (this->field_0x86.HALF.HI != 0) {
|
||||
sub_080AEFB4(this);
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action6(Entity* this) {
|
||||
Entity* target;
|
||||
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (this->field_0x74.HALF.LO) {
|
||||
case 0:
|
||||
if (this->actionDelay != 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->actionDelay = 0x70;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->field_0x74.HALF.LO++;
|
||||
SoundReq(SFX_150);
|
||||
target = CreateProjectileWithParent(this, 0x18, 0);
|
||||
if (target != NULL) {
|
||||
PositionRelative(this, target, 0, -0x100000);
|
||||
target->parent = this;
|
||||
}
|
||||
} else if (this->actionDelay == 0x40) {
|
||||
SoundReq(SFX_196);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (this->field_0xf != 0) {
|
||||
this->field_0xf = 0;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this->field_0xf == 0) {
|
||||
this->field_0xf = 1;
|
||||
SoundReq(SFX_14F);
|
||||
}
|
||||
if (this->actionDelay) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->actionDelay = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0Action7(Entity* this) {
|
||||
Entity* fx;
|
||||
u32 tmp;
|
||||
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
SetRoomFlag(1);
|
||||
} else {
|
||||
if ((this->actionDelay & 7) == 0) {
|
||||
fx = CreateFx(this, 2, 0);
|
||||
if (fx != NULL) {
|
||||
tmp = Random() & 0x3f3f;
|
||||
fx->x.HALF.HI = ((tmp & 0xff) - 0x20) + fx->x.HALF.HI;
|
||||
fx->y.HALF.HI = ((tmp >> 8) & 0xff) - 0x20 + fx->y.HALF.HI;
|
||||
#ifndef EU
|
||||
fx->spritePriority.b0 = 2;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType1Action0(Entity* this) {
|
||||
Entity* enemy;
|
||||
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->actionDelay = 0;
|
||||
this->spriteOffsetY = -1;
|
||||
PositionRelative(this->parent, this, 0, 0x10000);
|
||||
enemy = CreateEnemy(VAATI_REBORN_ENEMY, 2);
|
||||
enemy->parent = this;
|
||||
enemy->attachedEntity = this->parent;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType1Action1(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
if (parent->field_0x80.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->damageType = 0x30;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
}
|
||||
} else {
|
||||
if (parent->field_0x80.HALF.LO != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->damageType = 0x2f;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
} else {
|
||||
if (((this->bitfield & 0x80) != 0) && (0 < this->iframes)) {
|
||||
parent->iframes = this->iframes;
|
||||
parent->bitfield = this->bitfield;
|
||||
}
|
||||
if ((this->frames.all & 0x40) != 0) {
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->field_0x74.HALF.HI == 0) {
|
||||
if (parent->action != 2) {
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->flags |= 0x80;
|
||||
}
|
||||
} else {
|
||||
if (parent->action == 2) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->flags &= 0x7f;
|
||||
}
|
||||
}
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(this->parent, this, 0, 0x10000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType2Action0(Entity* this) {
|
||||
Entity* source;
|
||||
|
||||
source = this->parent->parent;
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->spriteOffsetY = -2;
|
||||
this->direction = 0xff;
|
||||
PositionRelative(source, this, 0, 0x20000);
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType2Action1(Entity* this) {
|
||||
u8 parentDirection;
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
if (parent->field_0x74.HALF.LO == 0) {
|
||||
if (this->field_0x74.HALF.LO != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
}
|
||||
parentDirection = parent->parent->direction;
|
||||
if (parentDirection != 0xff) {
|
||||
if (this->field_0x74.HALF.HI == 0) {
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
}
|
||||
if (parentDirection != this->direction) {
|
||||
this->direction = parentDirection;
|
||||
InitAnimationForceUpdate(this, parentDirection >> 3);
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x74.HALF.HI != 0) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(parent->parent, this, 0, 0x20000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType3Action0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->direction = 0xff;
|
||||
this->spriteOffsetY = -1;
|
||||
InitAnimationForceUpdate(this, this->field_0x74.HALF.LO);
|
||||
sub_0803DC0C(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType3Action1(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
|
||||
if (this->parent->direction != 0xff) {
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
}
|
||||
if (parent->direction != this->direction) {
|
||||
this->direction = parent->direction;
|
||||
InitAnimationForceUpdate(this, this->direction >> 3);
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x74.HALF.LO != 0) {
|
||||
this->field_0x74.HALF.LO = 0;
|
||||
this->direction = 0xff;
|
||||
InitAnimationForceUpdate(this, 2);
|
||||
}
|
||||
}
|
||||
sub_0803DC0C(this);
|
||||
}
|
||||
|
||||
void sub_0803DC0C(Entity* this) {
|
||||
Entity* parent;
|
||||
const xy* tmp;
|
||||
|
||||
parent = this->parent;
|
||||
tmp = &gUnk_080D04C8[this->actionDelay];
|
||||
this->spriteSettings.b.draw = parent->spriteSettings.b.draw;
|
||||
this->spriteOffsetX = parent->spriteOffsetX;
|
||||
PositionRelative(parent, this, tmp->x << 0x10, (tmp->y + 1) * 0x10000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType1PreAction(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->damageType != 0x30) {
|
||||
return;
|
||||
}
|
||||
parent = this->parent;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
if ((this->bitfield & 0x80) != 0) {
|
||||
if (gUnk_080D04D0[parent->field_0x86.HALF.LO] > this->currentHealth) {
|
||||
if (2 < ++parent->field_0x86.HALF.LO) {
|
||||
this->flags &= 0x7f;
|
||||
parent->action = 7;
|
||||
parent->flags &= 0x7f;
|
||||
parent->actionDelay = 0x80;
|
||||
parent->spriteOffsetX = 0;
|
||||
parent->direction = -1;
|
||||
this->actionDelay = 0;
|
||||
SoundReq(SONG_STOP_BGM);
|
||||
gArea.musicIndex = gArea.pMusicIndex;
|
||||
return;
|
||||
}
|
||||
this->actionDelay = 1;
|
||||
this->field_0x76.HALF.HI = 0xff;
|
||||
}
|
||||
if (0 < this->iframes) {
|
||||
SoundReq(0x127);
|
||||
sub_08080964(0xc, 1);
|
||||
if (this->actionDelay == 0)
|
||||
this->actionDelay = 0x48;
|
||||
}
|
||||
}
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->damageType = 0x2f;
|
||||
this->field_0x74.HALF.LO = 1;
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
parent->field_0x74.HALF.LO = 0xf0;
|
||||
} else {
|
||||
parent->field_0x74.HALF.LO = 0x70;
|
||||
this->currentHealth = 0xff;
|
||||
}
|
||||
parent->action = 1;
|
||||
parent->actionDelay = 1;
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803DD78(Entity* this) {
|
||||
u32 random_number;
|
||||
|
||||
random_number = ((u32)Random() & 0x7c) >> 2;
|
||||
|
||||
switch (this->field_0x86.HALF.LO) {
|
||||
case 0:
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 0x50;
|
||||
break;
|
||||
}
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 4:
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 0x50;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
break;
|
||||
case 2:
|
||||
if ((random_number & 8) != 0) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
} else {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 0x50;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if ((random_number & 8) != 0) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 0x50;
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 2:
|
||||
if ((random_number & 0xf) < 3) {
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
} else {
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
this->field_0x74.HALF.HI = 1;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
break;
|
||||
case 4:
|
||||
if (9 < random_number) {
|
||||
this->field_0x74.HALF.HI = 2;
|
||||
this->field_0x76.HALF.HI = (Random() & 1) + 2;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
this->field_0x74.HALF.HI = 0;
|
||||
this->field_0x76.HALF.HI = 1;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this->field_0x82.HALF.HI = (this->field_0x82.HALF.HI + 1) % 6;
|
||||
}
|
||||
|
||||
u32 sub_0803DEE0(Entity* this) {
|
||||
u32 randomValue;
|
||||
u32 ret;
|
||||
|
||||
ret = 2;
|
||||
randomValue = (Random() & 0xf8) >> 3;
|
||||
if (this->field_0x80.HALF.LO) {
|
||||
switch (this->field_0x86.HALF.LO) {
|
||||
case 0:
|
||||
ret = this->field_0x82.HALF.LO & 1;
|
||||
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) & 3;
|
||||
break;
|
||||
case 1:
|
||||
switch (this->field_0x82.HALF.LO) {
|
||||
case 0:
|
||||
case 2:
|
||||
ret = 3;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
ret = 1;
|
||||
break;
|
||||
case 4:
|
||||
if (randomValue & 8) {
|
||||
ret = 3;
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) % 5;
|
||||
break;
|
||||
case 2:
|
||||
switch (this->field_0x82.HALF.LO) {
|
||||
case 0:
|
||||
case 3:
|
||||
ret = 3;
|
||||
break;
|
||||
case 1:
|
||||
ret = 0;
|
||||
if (randomValue > 5) {
|
||||
ret = 3;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
ret = 0;
|
||||
if (randomValue < 10) {
|
||||
ret = 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
ret = 0;
|
||||
break;
|
||||
default:
|
||||
ret = 2;
|
||||
}
|
||||
this->field_0x82.HALF.LO = (this->field_0x82.HALF.LO + 1) % 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void VaatiRebornEnemyType0PreAction(Entity* this) {
|
||||
u32 bVar1;
|
||||
|
||||
if (this->action != 0) {
|
||||
*(u32*)&this->field_0x78 = this->x.WORD;
|
||||
this->field_0x7c = this->y;
|
||||
}
|
||||
if (this->field_0x76.HALF.LO == 0) {
|
||||
if ((this->direction == 0xff) || sub_08049FA0(this)) {
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->animationState = (this->animationState + 1) & 3;
|
||||
this->spriteOffsetX = gUnk_080D04D3[this->animationState];
|
||||
}
|
||||
return;
|
||||
}
|
||||
bVar1 = sub_08049EE4(this);
|
||||
this->direction = (bVar1 & 0x10) | 8;
|
||||
this->field_0x76.HALF.LO = 0x10;
|
||||
} else {
|
||||
this->field_0x76.HALF.LO--;
|
||||
}
|
||||
if (this->field_0x80.HALF.LO == 0) {
|
||||
this->animationState = (this->animationState + 1) & 3;
|
||||
this->spriteOffsetX = gUnk_080D04D3[this->animationState];
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0803E028(Entity* this) {
|
||||
u32 ret;
|
||||
s32 tmp;
|
||||
|
||||
ret = 0;
|
||||
if ((this->field_0x74.HALF.HI != 2) && ((Random() & 1) != 0)) {
|
||||
return 0;
|
||||
}
|
||||
if (this->field_0x76.HALF.HI != 1) {
|
||||
return ret;
|
||||
}
|
||||
tmp = gRoomControls.roomOriginX + 0x58;
|
||||
if (tmp > gPlayerEntity.x.HALF.HI) {
|
||||
return ret;
|
||||
}
|
||||
tmp = gRoomControls.roomOriginY + 0x58;
|
||||
if (tmp > gPlayerEntity.x.HALF.HI) {
|
||||
return ret;
|
||||
}
|
||||
tmp = gRoomControls.roomOriginY + 0xf8;
|
||||
if (tmp >= gPlayerEntity.x.HALF.HI) {
|
||||
this->field_0x80.HALF.HI += 5;
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,333 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "audio.h"
|
||||
#include "textbox.h"
|
||||
#include "coord.h"
|
||||
#include "functions.h"
|
||||
|
||||
void sub_08045A00(Entity*);
|
||||
void sub_08045A28(Entity*);
|
||||
|
||||
void VaatiTransfiguredEyeFunction0(Entity*);
|
||||
void VaatiTransfiguredEyeFunction1(Entity*);
|
||||
void VaatiTransfiguredEyeNoop(Entity*);
|
||||
void VaatiTransfiguredEyeFunction0Action0(Entity*);
|
||||
void VaatiTransfiguredEyeFunction0Action1(Entity*);
|
||||
void VaatiTransfiguredEyeFunction0Action2(Entity*);
|
||||
void VaatiTransfiguredEyeFunction0Action3(Entity*);
|
||||
void VaatiTransfiguredEyeFunction0Action4(Entity*);
|
||||
|
||||
void (*const vaatiTransfiguredEyeFunctions[])(Entity*) = {
|
||||
VaatiTransfiguredEyeFunction0,
|
||||
VaatiTransfiguredEyeFunction1,
|
||||
VaatiTransfiguredEyeFunction0,
|
||||
sub_0804A7D4,
|
||||
sub_08001242,
|
||||
VaatiTransfiguredEyeNoop,
|
||||
};
|
||||
|
||||
void (*const vaatiTransfiguredEyeFunction0Actions[])(Entity*) = {
|
||||
VaatiTransfiguredEyeFunction0Action0, VaatiTransfiguredEyeFunction0Action1, VaatiTransfiguredEyeFunction0Action2,
|
||||
VaatiTransfiguredEyeFunction0Action3, VaatiTransfiguredEyeFunction0Action4,
|
||||
};
|
||||
|
||||
struct xy {
|
||||
s8 x;
|
||||
s8 y;
|
||||
} PACKED;
|
||||
|
||||
const struct xy gUnk_080D18B4[] = { { 0xe8, 0xf6 }, { 0xf6, 0xe8 }, { 0x0a, 0xe8 }, { 0x18, 0xf6 },
|
||||
{ 0x18, 0x0a }, { 0x0a, 0x18 }, { 0xf6, 0x18 }, { 0xe8, 0x0a } };
|
||||
|
||||
void VaatiTransfiguredEye(Entity* this) {
|
||||
EnemyFunctionHandler(this, vaatiTransfiguredEyeFunctions);
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0(Entity* this) {
|
||||
vaatiTransfiguredEyeFunction0Actions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction1(Entity* this) {
|
||||
u8 bVar1;
|
||||
Entity* pEVar4;
|
||||
|
||||
if (this->type != 0) {
|
||||
pEVar4 = this->parent->parent;
|
||||
if ((this->bitfield & 0x80) != 0) {
|
||||
bVar1 = this->bitfield & 0x3f;
|
||||
if ((bVar1 == 0xe) || (bVar1 == 0x15)) {
|
||||
|
||||
if (this->field_0x80.HALF.HI == 0) {
|
||||
this->action = 3;
|
||||
this->field_0x80.HALF.HI += 1;
|
||||
InitializeAnimation(this, (this->type << 3) | (this->actionDelay + 2));
|
||||
InitializeAnimation(this->parent, (this->parent->type << 3) | (this->actionDelay + 2));
|
||||
}
|
||||
if (this->actionDelay != 0) {
|
||||
SoundReq(SFX_17A);
|
||||
} else {
|
||||
SoundReq(SFX_ITEM_GLOVES_KNOCKBACK);
|
||||
}
|
||||
} else {
|
||||
if (this->currentHealth != 0xff) {
|
||||
this->currentHealth = 0xff;
|
||||
if (this->actionDelay != 0 && (pEVar4->field_0x80.HALF.HI != 0)) {
|
||||
pEVar4->field_0x76.HALF.LO |= (1 << this->type2);
|
||||
if (this->cutsceneBeh.HALF.HI == 0) {
|
||||
this->cutsceneBeh.HALF.HI += 1;
|
||||
InitializeAnimation(this, this->type << 3 | 6);
|
||||
InitializeAnimation(this->parent, this->parent->type << 3 | 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_0804AA30(this, vaatiTransfiguredEyeFunctions);
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeNoop(Entity* this) {
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action0(Entity* this) {
|
||||
Entity* child;
|
||||
u8 bVar2;
|
||||
|
||||
bVar2 = gTextBox.doTextBox & 0x7f;
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->field_0x80.HALF.LO = bVar2;
|
||||
this->field_0x80.HALF.HI = bVar2;
|
||||
this->cutsceneBeh.HALF.HI = bVar2;
|
||||
this->field_0xf = bVar2;
|
||||
this->field_0x82.HALF.LO = 0x30;
|
||||
this->field_0x82.HALF.HI = bVar2;
|
||||
if (this->type == 0) {
|
||||
sub_08045A00(this);
|
||||
child = CreateEnemy(VAATI_TRANSFIGURED_EYE, 1);
|
||||
if (child != NULL) {
|
||||
child->parent = this;
|
||||
this->attachedEntity = child;
|
||||
child->actionDelay = this->actionDelay;
|
||||
child->type2 = this->type2;
|
||||
CopyPosition(this, child);
|
||||
}
|
||||
} else {
|
||||
this->spriteOffsetY = 1;
|
||||
}
|
||||
InitializeAnimation(this, (u32)this->type << 3 | 1);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action1(Entity* this) {
|
||||
sub_08045A28(this);
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
if (this->type != 0) {
|
||||
this->flags |= 0x80;
|
||||
}
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, this->type << 3);
|
||||
}
|
||||
} else {
|
||||
if (--this->field_0x82.HALF.LO == 0) {
|
||||
this->spriteSettings.b.draw = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action2(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
sub_08045A28(this);
|
||||
parent = this->parent;
|
||||
if (this->type != 0) {
|
||||
parent = parent->parent;
|
||||
}
|
||||
if ((parent->action == 3) && (parent->field_0x80.HALF.LO == 1)) {
|
||||
this->action = 4;
|
||||
this->field_0xf = 0;
|
||||
if (this->type != 0) {
|
||||
this->flags &= 0x7f;
|
||||
if (this->actionDelay != 0) {
|
||||
InitializeAnimation(this, this->type << 3 | 5);
|
||||
InitializeAnimation(this->parent, this->parent->type << 3 | 5);
|
||||
} else {
|
||||
InitializeAnimation(this, this->type << 3 | 4);
|
||||
InitializeAnimation(this->parent, this->parent->type << 3 | 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action3(Entity* this) {
|
||||
sub_08045A28(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
if (this->type != 0) {
|
||||
if (this->actionDelay == 0) {
|
||||
this->damageType = 0x32;
|
||||
} else {
|
||||
this->parent->parent->field_0x76.HALF.LO |= (1 << this->type2);
|
||||
this->damageType = 0x31;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiTransfiguredEyeFunction0Action4(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
sub_08045A28(this);
|
||||
if (this->field_0xf == 0) {
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->field_0xf = 0x20;
|
||||
}
|
||||
} else {
|
||||
parent = this->parent;
|
||||
if (this->type != 0) {
|
||||
parent = parent->parent;
|
||||
}
|
||||
if ((parent->animationState < 3) && (parent->action != 3)) {
|
||||
this->action = 1;
|
||||
this->field_0xf = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
this->cutsceneBeh.HALF.HI = 0;
|
||||
if (this->type != 0) {
|
||||
this->damageType = 0x33;
|
||||
}
|
||||
if ((parent->field_0x74.HALF.HI >> this->type2 & 1U) != 0) {
|
||||
this->actionDelay = 1;
|
||||
} else {
|
||||
this->actionDelay = 0;
|
||||
}
|
||||
InitializeAnimation(this, this->type << 3 | 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08045A00(Entity* this) {
|
||||
const struct xy* t = &gUnk_080D18B4[this->type2];
|
||||
PositionRelative(this->parent, this, t->x << 0x10, (t->y + 3) * 0x10000);
|
||||
}
|
||||
|
||||
void sub_08045A28(Entity* this) {
|
||||
u32 frames;
|
||||
u32 type;
|
||||
|
||||
if (this->field_0x82.HALF.LO == 0) {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
frames = this->frames.all & 0x70;
|
||||
type = this->type;
|
||||
if (type == 0) {
|
||||
sub_08045A00(this);
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 0:
|
||||
switch (frames) {
|
||||
case 0x20:
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0801D2B4(this, 0x13e);
|
||||
break;
|
||||
case 0x00:
|
||||
case 0x40:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (frames) {
|
||||
case 0x10:
|
||||
this->field_0x82.HALF.HI = type;
|
||||
sub_0801D2B4(this, 0x13b);
|
||||
break;
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (frames) {
|
||||
case 0x20:
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0801D2B4(this, 0x13e);
|
||||
break;
|
||||
case 0x10:
|
||||
this->field_0x82.HALF.HI = 0;
|
||||
sub_0801D2B4(this, 0x13b);
|
||||
break;
|
||||
case 0x40:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (frames) {
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
switch (this->field_0x82.HALF.HI) {
|
||||
case 0:
|
||||
switch (this->frames.all & 0x70) {
|
||||
case 0x10:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13b);
|
||||
break;
|
||||
case 0x20:
|
||||
this->field_0x82.HALF.HI = 1;
|
||||
sub_0801D2B4(this, 0x13e);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: {
|
||||
u32 temp = this->frames.all & 0x70;
|
||||
switch (temp) {
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = temp;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
case 0x10:
|
||||
this->field_0x82.HALF.HI = 2;
|
||||
sub_0801D2B4(this, 0x13b);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
case 2:
|
||||
switch (this->frames.all & 0x70) {
|
||||
case 0:
|
||||
this->field_0x82.HALF.HI = this->frames.all & 0x70;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
#include "entity.h"
|
||||
#include "audio.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
|
||||
void sub_080485D8(Entity*);
|
||||
void sub_080485FC(Entity*);
|
||||
void VaatiWrathEyeAction0(Entity*);
|
||||
void VaatiWrathEyeAction1(Entity*);
|
||||
void VaatiWrathEyeAction2(Entity*);
|
||||
void VaatiWrathEyeAction3(Entity*);
|
||||
void VaatiWrathEyeAction4(Entity*);
|
||||
void VaatiWrathEyeAction5(Entity*);
|
||||
void VaatiWrathEyeAction6(Entity*);
|
||||
void VaatiWrathEyeAction7(Entity*);
|
||||
void VaatiWrathEyeAction8(Entity*);
|
||||
void VaatiWrathEyeAction9(Entity*);
|
||||
|
||||
void (*const vaatiWrathEyeActions[])(Entity*) = {
|
||||
VaatiWrathEyeAction0, VaatiWrathEyeAction1, VaatiWrathEyeAction2, VaatiWrathEyeAction3, VaatiWrathEyeAction4,
|
||||
VaatiWrathEyeAction5, VaatiWrathEyeAction6, VaatiWrathEyeAction7, VaatiWrathEyeAction8, VaatiWrathEyeAction9,
|
||||
};
|
||||
|
||||
const s8 gUnk_080D1D70[] = { 0xee, 0x01, 0xfa, 0x04, 0x06, 0x04, 0x13, 0x01 };
|
||||
|
||||
const s8 gUnk_080D1D78[] = { 0xfd, 0xfc, 0xfb, 0xfa, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfc,
|
||||
0xfb, 0xfa, 0xf9, 0xfa, 0xfb, 0xfb, 0xfc, 0xfd, 0xfc, 0xfb, 0xfa,
|
||||
0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfd, 0xfc, 0xfb, 0xfa, 0xf9 };
|
||||
|
||||
const s8 gUnk_080D1D98[] = { 0xe8, 0x04, 0xf8, 0x08, 0x08, 0x08, 0x18, 0x04 };
|
||||
|
||||
void VaatiWrathEye(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
vaatiWrathEyeActions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction0(Entity* this) {
|
||||
if ((gScreenTransition.field_0x38 & 1) != 0) {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
} else {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
SoundReq(SFX_166);
|
||||
}
|
||||
sub_080485D8(this);
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction1(Entity* this) {
|
||||
sub_080485D8(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction2(Entity* this) {
|
||||
sub_080485D8(this);
|
||||
if ((gScreenTransition.field_0x39 & 3) == 0) {
|
||||
this->action = 3;
|
||||
this->flags |= 0x80;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction3(Entity* this) {
|
||||
u32 direction;
|
||||
Entity* parent;
|
||||
u32 x;
|
||||
u32 y;
|
||||
|
||||
const s8* ptr;
|
||||
|
||||
parent = this->parent;
|
||||
if (parent->field_0x78.HALF.HI != 0) {
|
||||
sub_080485D8(this);
|
||||
} else {
|
||||
ptr = &gUnk_080D1D98[this->type * 2];
|
||||
x = parent->x.HALF.HI + ptr[0];
|
||||
y = parent->y.HALF.HI + ptr[1];
|
||||
direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y);
|
||||
this->direction = direction;
|
||||
sub_0806F69C(this);
|
||||
this->height.HALF.HI = this->parent->height.HALF.HI;
|
||||
if ((this->x.HALF.HI == x) && (this->y.HALF.HI == y)) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x3c;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction4(Entity* this) {
|
||||
sub_080485FC(this);
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
InitializeAnimation(this, 3);
|
||||
}
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 5;
|
||||
this->actionDelay = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction5(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->action = 6;
|
||||
if (this->parent->currentHealth >= 0x15) {
|
||||
this->actionDelay = 120;
|
||||
} else {
|
||||
this->actionDelay = 0x3c;
|
||||
}
|
||||
this->attachedEntity = NULL;
|
||||
InitializeAnimation(this, 5);
|
||||
SoundReq(SFX_19B);
|
||||
}
|
||||
sub_080485FC(this);
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction6(Entity* this) {
|
||||
Entity* pEVar3;
|
||||
|
||||
sub_080485FC(this);
|
||||
GetNextFrame(this);
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
InitializeAnimation(this, 6);
|
||||
}
|
||||
} else {
|
||||
if (this->frames.b.f3) {
|
||||
this->action = 7;
|
||||
this->actionDelay = 120;
|
||||
this->field_0xf = 0;
|
||||
} else {
|
||||
if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
pEVar3 = CreateProjectile(0x24);
|
||||
if (pEVar3 != NULL) {
|
||||
pEVar3->parent = this;
|
||||
this->attachedEntity = pEVar3;
|
||||
PositionRelative(this, pEVar3, 0, 0xc0000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction7(Entity* this) {
|
||||
sub_080485FC(this);
|
||||
GetNextFrame(this);
|
||||
if (this->field_0xf != 0) {
|
||||
this->action = 8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7f;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
CreateFx(this, 0x1f, 0x40);
|
||||
this->parent->field_0x7a.HALF.HI |= 0x10 << this->type;
|
||||
} else {
|
||||
if (--this->actionDelay != 0) {
|
||||
return;
|
||||
}
|
||||
this->action = 5;
|
||||
this->actionDelay = 0;
|
||||
this->parent->field_0x7a.HALF.HI |= 1 << this->type;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction8(Entity* this) {
|
||||
if (this->parent->action == 0xb) {
|
||||
this->actionDelay = 0x3c;
|
||||
} else {
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 9;
|
||||
this->flags |= 0x80;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
sub_080485FC(this);
|
||||
SoundReq(SFX_166);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiWrathEyeAction9(Entity* this) {
|
||||
sub_080485FC(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 1;
|
||||
this->parent->field_0x7a.HALF.HI = (this->parent->field_0x7a.HALF.HI & 0xf) | (1 << this->type);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080485D8(Entity* this) {
|
||||
const s8* ptr;
|
||||
|
||||
ptr = &gUnk_080D1D70[this->type * 2];
|
||||
sub_0806FA90(this->parent, this, ptr[0], ptr[1]);
|
||||
}
|
||||
|
||||
void sub_080485FC(Entity* this) {
|
||||
const s8* ptr;
|
||||
|
||||
ptr = &gUnk_080D1D98[this->type * 2];
|
||||
sub_0806FA90(this->parent, this, ptr[0], ptr[1]);
|
||||
this->height.HALF.HI = gUnk_080D1D78[this->type * 8 + (this->parent->field_0x78.HALF.LO >> 4 & 7)];
|
||||
}
|
||||
+2
-2
@@ -48,11 +48,11 @@ typedef struct {
|
||||
|
||||
extern struct_03003DD0 gUnk_03003DD0;
|
||||
extern u32 _call_via_r0(u32*);
|
||||
extern u32 _EntUpdate;
|
||||
extern u32 _ClearAndUpdateEntities;
|
||||
|
||||
void DeleteThisEntity(void) {
|
||||
DeleteEntityAny(gUnk_03003DD0.field_0x8);
|
||||
_call_via_r0((u32*)&_EntUpdate);
|
||||
_call_via_r0((u32*)&_ClearAndUpdateEntities);
|
||||
}
|
||||
|
||||
void DeleteManager(OtherEntity*);
|
||||
|
||||
@@ -22,7 +22,7 @@ void Manager34_Main(Manager34* this) {
|
||||
|
||||
void sub_0805DBB4(Manager34* this) {
|
||||
this->manager.action = 1;
|
||||
this->field_0x20 = gScreenTransition.filler[0] * 0x3c;
|
||||
this->field_0x20 = gScreenTransition.field_0x3d * 0x3c;
|
||||
}
|
||||
|
||||
void sub_0805DBCC(Manager34* this) {
|
||||
|
||||
@@ -4,134 +4,134 @@
|
||||
|
||||
//clang-format off
|
||||
void (*const gNPCFunctions[][3])(Entity* ent) = {
|
||||
/*0x00*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x01*/ { Gentari, NULL, Gentari_Fusion },
|
||||
/*0x02*/ { Festari, NULL, Festari_Fusion },
|
||||
/*0x03*/ { ForestMinish, ForestMinish_Head, ForestMinish_Fusion },
|
||||
/*0x04*/ { Postman, NULL, Postman_Fusion },
|
||||
/*0x05*/ { NPC5, NULL, NULL },
|
||||
/*0x06*/ { Townsperson, Townsperson_Head, Townsperson_Fusion },
|
||||
/*0x07*/ { Kid, Kid_Head, Kid_Fusion },
|
||||
/*0x08*/ { Guard, Guard_Head, NULL },
|
||||
/*0x09*/ { NPC9, NULL, NULL },
|
||||
/*0x0a*/ { Stamp, NULL, NULL },
|
||||
/*0x0b*/ { Maid, Maid_Head, NULL },
|
||||
/*0x0c*/ { Marcy, NULL, NULL },
|
||||
/*0x0d*/ { Wheaton, NULL, NULL },
|
||||
/*0x0e*/ { Pita, NULL, NULL },
|
||||
/*0x0f*/ { MinishEzlo, MinishEzlo_Head, NULL },
|
||||
/*0x10*/ { Mailbox, NULL, NULL },
|
||||
/*0x11*/ { Beedle, Beedle_Head, NULL },
|
||||
/*0x12*/ { Brocco, NULL, Brocco_Fusion },
|
||||
/*0x13*/ { SittingPerson, SittingPerson_Head, SittingPerson_Fusion },
|
||||
/*0x14*/ { Pina, NULL, Pina_Fusion },
|
||||
/*0x15*/ { Guard, Guard_Head, NULL },
|
||||
/*0x16*/ { Maid, Maid_Head, NULL },
|
||||
/*0x17*/ { Din, NULL, Din_Fusion },
|
||||
/*0x18*/ { Nayru, NULL, Nayru_Fusion },
|
||||
/*0x19*/ { Farore, NULL, Farore_Fusion },
|
||||
/*0x1a*/ { Sturgeon, Sturgeon_Head, Sturgeon_Fusion },
|
||||
/*0x1b*/ { TingleSiblings, NULL, TingleSiblings_Fusion },
|
||||
/*0x1c*/ { Stockwell, NULL, NULL },
|
||||
/*0x1d*/ { Talon, Talon_Head, Talon_Fusion },
|
||||
/*0x1e*/ { Malon, NULL, Malon_Fusion },
|
||||
/*0x1f*/ { Epona, NULL, Epona_Fusion },
|
||||
/*0x20*/ { MilkCart, NULL, NULL },
|
||||
/*0x21*/ { GhostBrothers, NULL, GhostBrothers_Fusion },
|
||||
/*0x22*/ { Smith, Smith_Head, Smith_Fusion },
|
||||
/*0x23*/ { NPC23, NULL, NULL },
|
||||
/*0x24*/ { KingDaltus, NULL, KingDaltus_Fusion },
|
||||
/*0x25*/ { MinisterPotho, NULL, MinisterPotho_Fusion },
|
||||
/*0x26*/ { NPC26, NULL, NULL },
|
||||
/*0x27*/ { Vaati, NULL, NULL },
|
||||
/*0x28*/ { Zelda, NULL, NULL },
|
||||
/*0x29*/ { Mutoh, Mutoh_Head, Mutoh_Fusion },
|
||||
/*0x2a*/ { Carpenter, Carpenter_Head, Carpenter_Fusion },
|
||||
/*0x2b*/ { CastorWildsStatue, NULL, CastorWildsStatue_Fusion },
|
||||
/*0x2c*/ { Cat, NULL, Cat_Fusion },
|
||||
/*0x2d*/ { MountainMinish, MountainMinish_Head, MountainMinish_Fusion },
|
||||
/*0x2e*/ { ZeldaFollower, NULL, NULL },
|
||||
/*0x2f*/ { Melari, Melari_Head, Melari_Fusion },
|
||||
/*0x30*/ { BladeBrothers, NULL, BladeBrothers_Fusion },
|
||||
/*0x31*/ { Cow, NULL, Cow_Fusion },
|
||||
/*0x32*/ { Goron, NULL, Goron_Fusion },
|
||||
/*0x33*/ { GoronMerchant, NULL, NULL },
|
||||
/*0x34*/ { Gorman, Gorman_Head, NULL },
|
||||
/*0x35*/ { Dog, Dog_Head, Dog_Fusion },
|
||||
/*0x36*/ { Syrup, Syrup_Head, NULL },
|
||||
/*0x37*/ { Rem, NULL, NULL },
|
||||
/*0x38*/ { TownMinish, TownMinish_Head, TownMinish_Fusion },
|
||||
/*0x39*/ { Librari, NULL, Librari_Fusion },
|
||||
/*0x3a*/ { Percy, Percy_Head, Percy_Fusion },
|
||||
/*0x3b*/ { VaatiReborn, NULL, NULL },
|
||||
/*0x3c*/ { MoblinLady, NULL, NULL },
|
||||
/*0x3d*/ { Librarians, NULL, NULL },
|
||||
/*0x3e*/ { Farmers, Farmers_Head, Farmers_Fusion },
|
||||
/*0x3f*/ { Carlov, NULL, NULL },
|
||||
/*0x40*/ { Dampe, NULL, Dampe_Fusion },
|
||||
/*0x41*/ { DrLeft, NULL, NULL },
|
||||
/*0x42*/ { KingGustaf, NULL, NULL },
|
||||
/*0x43*/ { Gina, NULL, Gina_Fusion },
|
||||
/*0x44*/ { Simon, NULL, NULL },
|
||||
/*0x45*/ { Anju, NULL, Anju_Fusion },
|
||||
/*0x46*/ { Mama, Mama_Head, Mama_Fusion },
|
||||
/*0x47*/ { Emma, NULL, NULL },
|
||||
/*0x48*/ { Teachers, Teachers_Head, Teachers_Fusion },
|
||||
/*0x49*/ { WindTribespeople, WindTribespeople_Head, WindTribespeople_Fusion },
|
||||
/*0x4a*/ { Gregal, NULL, Gregal_Fusion },
|
||||
/*0x4b*/ { MayorHagen, NULL, MayorHagen_Fusion },
|
||||
/*0x4c*/ { BigGoron, NULL, NULL },
|
||||
/*0x4d*/ { EzloCap, NULL, NULL },
|
||||
/*0x4e*/ { NPC4E, NULL, NPC4E_Fusion },
|
||||
/*0x4f*/ { NPC4F, NULL, NULL },
|
||||
/*0x50*/ { ClothesRack, NULL, NULL },
|
||||
/*0x51*/ { PicolyteBottle, NULL, NULL },
|
||||
/*0x52*/ { SmallTownMinish, NULL, NULL },
|
||||
/*0x53*/ { HurdyGurdyMan, HurdyGurdyMan_Head, HurdyGurdyMan_Fusion },
|
||||
/*0x54*/ { Cucco, NULL, Cucco_Fusion },
|
||||
/*0x55*/ { CuccoChick, NULL, CuccoChick_Fusion },
|
||||
/*0x56*/ { FusionMenuNPC, FusionMenuNPC_Head, NULL },
|
||||
/*0x57*/ { Phonograph, NULL, NULL },
|
||||
/*0x58*/ { NPC58, NPC58_Head, NULL },
|
||||
/*0x59*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5a*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5b*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5c*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5d*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5e*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x5f*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x60*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x61*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x62*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x63*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x64*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x65*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x66*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x67*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x68*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x69*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6a*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6b*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6c*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6d*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6e*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x6f*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x70*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x71*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x72*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x73*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x74*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x75*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x76*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x77*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x78*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x79*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7a*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7b*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7c*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7d*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7e*/ { DeleteEntity, NULL, NULL },
|
||||
/*0x7f*/ { DeleteEntity, NULL, NULL }
|
||||
[NPC_NONE_0] = { DeleteEntity, NULL, NULL },
|
||||
[GENTARI] = { Gentari, NULL, Gentari_Fusion },
|
||||
[FESTARI] = { Festari, NULL, Festari_Fusion },
|
||||
[FOREST_MINISH] = { ForestMinish, ForestMinish_Head, ForestMinish_Fusion },
|
||||
[POSTMAN] = { Postman, NULL, Postman_Fusion },
|
||||
[NPC_UNK_5] = { NPC5, NULL, NULL },
|
||||
[TPWNSPERSON] = { Townsperson, Townsperson_Head, Townsperson_Fusion },
|
||||
[KID] = { Kid, Kid_Head, Kid_Fusion },
|
||||
[GUARD] = { Guard, Guard_Head, NULL },
|
||||
[NPC_UNK_9] = { NPC9, NULL, NULL },
|
||||
[STAMP] = { Stamp, NULL, NULL },
|
||||
[MAID] = { Maid, Maid_Head, NULL },
|
||||
[MARCY] = { Marcy, NULL, NULL },
|
||||
[WHEATON] = { Wheaton, NULL, NULL },
|
||||
[PITA] = { Pita, NULL, NULL },
|
||||
[MINISH_EZLO] = { MinishEzlo, MinishEzlo_Head, NULL },
|
||||
[MAILBOX] = { Mailbox, NULL, NULL },
|
||||
[BEEDLE] = { Beedle, Beedle_Head, NULL },
|
||||
[BROCCO] = { Brocco, NULL, Brocco_Fusion },
|
||||
[SITTING_PERSON] = { SittingPerson, SittingPerson_Head, SittingPerson_Fusion },
|
||||
[PINA] = { Pina, NULL, Pina_Fusion },
|
||||
[GUARD_1] = { Guard, Guard_Head, NULL },
|
||||
[MAID_1] = { Maid, Maid_Head, NULL },
|
||||
[DIN] = { Din, NULL, Din_Fusion },
|
||||
[NAYRU] = { Nayru, NULL, Nayru_Fusion },
|
||||
[FARORE] = { Farore, NULL, Farore_Fusion },
|
||||
[STURGEON] = { Sturgeon, Sturgeon_Head, Sturgeon_Fusion },
|
||||
[TINGLE_SIBLINGS] = { TingleSiblings, NULL, TingleSiblings_Fusion },
|
||||
[STOCKWELL] = { Stockwell, NULL, NULL },
|
||||
[TALON] = { Talon, Talon_Head, Talon_Fusion },
|
||||
[MALON] = { Malon, NULL, Malon_Fusion },
|
||||
[EPONA] = { Epona, NULL, Epona_Fusion },
|
||||
[MILK_CART] = { MilkCart, NULL, NULL },
|
||||
[GHOST_BROTHERS] = { GhostBrothers, NULL, GhostBrothers_Fusion },
|
||||
[SMITH] = { Smith, Smith_Head, Smith_Fusion },
|
||||
[NPC_UNK_23] = { NPC23, NULL, NULL },
|
||||
[KING_DALTUS] = { KingDaltus, NULL, KingDaltus_Fusion },
|
||||
[MINISTER_POTHO] = { MinisterPotho, NULL, MinisterPotho_Fusion },
|
||||
[NPC_UNK_26] = { NPC26, NULL, NULL },
|
||||
[VAATI] = { Vaati, NULL, NULL },
|
||||
[ZELDA] = { Zelda, NULL, NULL },
|
||||
[MUTOH] = { Mutoh, Mutoh_Head, Mutoh_Fusion },
|
||||
[CARPENTER] = { Carpenter, Carpenter_Head, Carpenter_Fusion },
|
||||
[CASTOR_WILDS_STATUE] = { CastorWildsStatue, NULL, CastorWildsStatue_Fusion },
|
||||
[CAT] = { Cat, NULL, Cat_Fusion },
|
||||
[MOUNTAIN_MINISH] = { MountainMinish, MountainMinish_Head, MountainMinish_Fusion },
|
||||
[ZELDA_FOLLOWER] = { ZeldaFollower, NULL, NULL },
|
||||
[MELARI] = { Melari, Melari_Head, Melari_Fusion },
|
||||
[BLADE_BROTHERS] = { BladeBrothers, NULL, BladeBrothers_Fusion },
|
||||
[COW] = { Cow, NULL, Cow_Fusion },
|
||||
[GORON] = { Goron, NULL, Goron_Fusion },
|
||||
[GORON_MERCHANT] = { GoronMerchant, NULL, NULL },
|
||||
[GORMAN] = { Gorman, Gorman_Head, NULL },
|
||||
[DOG] = { Dog, Dog_Head, Dog_Fusion },
|
||||
[SYRUP] = { Syrup, Syrup_Head, NULL },
|
||||
[REM] = { Rem, NULL, NULL },
|
||||
[TOWN_MINISH] = { TownMinish, TownMinish_Head, TownMinish_Fusion },
|
||||
[LIBRARI] = { Librari, NULL, Librari_Fusion },
|
||||
[PERCY] = { Percy, Percy_Head, Percy_Fusion },
|
||||
[VAATI_REBORN] = { VaatiReborn, NULL, NULL },
|
||||
[MOBLIN_LADY] = { MoblinLady, NULL, NULL },
|
||||
[LIBRARIANS] = { Librarians, NULL, NULL },
|
||||
[FARMERS] = { Farmers, Farmers_Head, Farmers_Fusion },
|
||||
[CARLOV] = { Carlov, NULL, NULL },
|
||||
[DAMPE] = { Dampe, NULL, Dampe_Fusion },
|
||||
[DR_LEFT] = { DrLeft, NULL, NULL },
|
||||
[KING_GUSTAF] = { KingGustaf, NULL, NULL },
|
||||
[GINA] = { Gina, NULL, Gina_Fusion },
|
||||
[SIMON] = { Simon, NULL, NULL },
|
||||
[ANJU] = { Anju, NULL, Anju_Fusion },
|
||||
[MAMA] = { Mama, Mama_Head, Mama_Fusion },
|
||||
[EMMA] = { Emma, NULL, NULL },
|
||||
[TEACHERS] = { Teachers, Teachers_Head, Teachers_Fusion },
|
||||
[WIND_TRIBESPEOPLE] = { WindTribespeople, WindTribespeople_Head, WindTribespeople_Fusion },
|
||||
[GREGAL] = { Gregal, NULL, Gregal_Fusion },
|
||||
[MAYOR_HAGEN] = { MayorHagen, NULL, MayorHagen_Fusion },
|
||||
[BIG_GORON] = { BigGoron, NULL, NULL },
|
||||
[EZLO_CAP] = { EzloCap, NULL, NULL },
|
||||
[NPC_UNK_4E] = { NPC4E, NULL, NPC4E_Fusion },
|
||||
[NPC_UNK_4F] = { NPC4F, NULL, NULL },
|
||||
[CLOTHES_RACK] = { ClothesRack, NULL, NULL },
|
||||
[PICOLYTE_BOTTLE] = { PicolyteBottle, NULL, NULL },
|
||||
[SMALL_TOWN_MINISH] = { SmallTownMinish, NULL, NULL },
|
||||
[HURDY_GURDY_MAN] = { HurdyGurdyMan, HurdyGurdyMan_Head, HurdyGurdyMan_Fusion },
|
||||
[CUCCO] = { Cucco, NULL, Cucco_Fusion },
|
||||
[CUCCO_CHICK] = { CuccoChick, NULL, CuccoChick_Fusion },
|
||||
[FUSION_MENU_NPC] = { FusionMenuNPC, FusionMenuNPC_Head, NULL },
|
||||
[PHONOGRAPH] = { Phonograph, NULL, NULL },
|
||||
[NPC_UNK_58] = { NPC58, NPC58_Head, NULL },
|
||||
[NPC_NONE_1] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_2] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_3] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_4] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_5] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_6] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_7] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_8] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_9] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_10] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_11] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_12] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_13] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_14] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_15] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_16] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_17] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_18] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_19] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_20] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_21] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_22] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_23] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_24] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_25] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_26] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_27] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_28] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_29] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_30] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_31] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_32] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_33] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_34] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_35] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_36] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_37] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_38] = { DeleteEntity, NULL, NULL },
|
||||
[NPC_NONE_39] = { DeleteEntity, NULL, NULL }
|
||||
};
|
||||
//clang-format on
|
||||
const u8 npc_unk[] = { 0x04, 0x05, 0x06, 0x06 };
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ void sub_08063D44(Entity* this) {
|
||||
sub_0806EE04(this, gUnk_0810F6BC[this->type], 0);
|
||||
switch (this->type) {
|
||||
case 0 ... 3:
|
||||
ent = sub_080A7EE0(0xc);
|
||||
ent = CreateProjectile(0xc);
|
||||
ent->parent = this;
|
||||
ent->field_0xf = 0x3c;
|
||||
break;
|
||||
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "script.h"
|
||||
#include "audio.h"
|
||||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void sub_08095CB0(Entity*);
|
||||
extern void CreateManager36(Entity*);
|
||||
extern void DeleteManager36(Entity*);
|
||||
extern void sub_0805DA90(Entity*, u32);
|
||||
|
||||
void VaatiAction0(Entity*);
|
||||
void VaatiAction1(Entity*);
|
||||
void sub_08066B74(Entity*, ScriptExecutionContext*);
|
||||
|
||||
void (*const vaatiActions[])(Entity*) = { VaatiAction0, VaatiAction1 };
|
||||
|
||||
void Vaati(Entity* this) {
|
||||
vaatiActions[this->action](this);
|
||||
this->palette.b.b0 = this->palette.b.b4 + (this->frameSpriteSettings & 1);
|
||||
}
|
||||
|
||||
void VaatiAction0(Entity* this) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->field_0x68.HALF.LO = 0;
|
||||
this->field_0x68.HALF.HI = 0;
|
||||
sub_0805E3A0(this, 2);
|
||||
sub_0807DD64(this);
|
||||
VaatiAction1(this);
|
||||
}
|
||||
|
||||
void VaatiAction1(Entity* this) {
|
||||
ScriptExecutionContext* tmp;
|
||||
sub_0807DD94(this, sub_08066B74);
|
||||
if ((*(s8*)&this->field_0x68.HALF.HI != 0) && ((gScreenTransition.frameCount & 3) == 0)) {
|
||||
sub_08095CB0(this);
|
||||
}
|
||||
|
||||
if ((this->frames.all & ~0x80) != 0) {
|
||||
switch (this->frames.all & ~0x80u) {
|
||||
case 1:
|
||||
EnqueueSFX(SFX_21C);
|
||||
break;
|
||||
case 2:
|
||||
EnqueueSFX(SFX_21E);
|
||||
break;
|
||||
case 3:
|
||||
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
tmp->intVariable = 4;
|
||||
CreateManager36(this);
|
||||
break;
|
||||
case 4:
|
||||
tmp = (*(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
tmp->intVariable = 4;
|
||||
DeleteManager36(this);
|
||||
EnqueueSFX(SFX_21D);
|
||||
break;
|
||||
}
|
||||
this->frames.b.f3 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08066B74(Entity* this, ScriptExecutionContext* context) {
|
||||
u8 animationState;
|
||||
u32 currentAction;
|
||||
u32 actions;
|
||||
|
||||
actions = context->postScriptActions & 0xfff00000;
|
||||
context->postScriptActions = context->postScriptActions & 0xfffff;
|
||||
if (actions != 0) {
|
||||
do {
|
||||
currentAction = (~actions + 1) & actions;
|
||||
actions = actions ^ currentAction;
|
||||
animationState = this->animationState >> 1;
|
||||
|
||||
switch (currentAction) {
|
||||
case 1 << 20:
|
||||
this->field_0x80.HWORD = animationState + 0x10;
|
||||
break;
|
||||
case 1 << 21:
|
||||
this->field_0x80.HWORD = animationState + 0x14;
|
||||
break;
|
||||
case 1 << 22:
|
||||
this->field_0x80.HWORD = animationState + 0x18;
|
||||
break;
|
||||
case 1 << 23:
|
||||
this->field_0x80.HWORD = animationState + 0x1c;
|
||||
break;
|
||||
case 1 << 24:
|
||||
this->field_0x80.HWORD = animationState + 0x20;
|
||||
break;
|
||||
case 1 << 25:
|
||||
this->field_0x80.HWORD = animationState + 0x24;
|
||||
break;
|
||||
case 1 << 26:
|
||||
this->field_0x80.HWORD = animationState + 0x28;
|
||||
break;
|
||||
case 1 << 27:
|
||||
this->field_0x80.HWORD = animationState + 0x2c;
|
||||
break;
|
||||
case 1 << 28:
|
||||
this->field_0x80.HWORD = animationState + 0x30;
|
||||
break;
|
||||
case 1 << 29:
|
||||
this->field_0x68.HALF.LO = 1;
|
||||
break;
|
||||
case 1 << 30:
|
||||
this->field_0x68.HALF.LO = 0xff;
|
||||
break;
|
||||
case 1 << 31:
|
||||
this->field_0x68.HALF.HI ^= 1;
|
||||
break;
|
||||
}
|
||||
} while (actions != 0);
|
||||
}
|
||||
HandlePostScriptActions(this, *(ScriptExecutionContext**)&this->cutsceneBeh);
|
||||
}
|
||||
|
||||
void sub_08066C94(Entity* this) {
|
||||
sub_0805DA90(this, 0);
|
||||
SoundReq(SFX_APPARATE);
|
||||
}
|
||||
|
||||
void sub_08066CA4(Entity* this) {
|
||||
sub_0805DA90(this, 1);
|
||||
SoundReq(SFX_EVAPORATE);
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
#include "global.h"
|
||||
#include "npc.h"
|
||||
#include "coord.h"
|
||||
#include "flags.h"
|
||||
#include "audio.h"
|
||||
#include "textbox.h"
|
||||
#include "functions.h"
|
||||
|
||||
void VaatiRebornAction0(Entity* this);
|
||||
void VaatiRebornAction1(Entity* this);
|
||||
void sub_0806B96C(Entity*);
|
||||
Entity* sub_0806B9BC(Entity*);
|
||||
|
||||
typedef struct xy {
|
||||
s8 x;
|
||||
s8 y;
|
||||
} PACKED xy;
|
||||
|
||||
void (*const vaatiRebornActions[])(Entity*) = {
|
||||
VaatiRebornAction0,
|
||||
VaatiRebornAction1,
|
||||
};
|
||||
const xy gUnk_08112F80[] = { { 10, -29 }, { -10, -29 }, { 15, -21 }, { -15, -21 } };
|
||||
|
||||
void VaatiReborn(Entity* this) {
|
||||
vaatiRebornActions[this->action](this);
|
||||
}
|
||||
|
||||
void VaatiRebornAction0(Entity* this) {
|
||||
Entity* entity;
|
||||
u32 i;
|
||||
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0;
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->y.HALF.HI -= 0xa0;
|
||||
this->actionDelay = 0xa0;
|
||||
this->field_0xf = 0x20;
|
||||
this->spriteOffsetY = 0x20;
|
||||
for (i = 0; i < 4; i++) {
|
||||
entity = CreateNPC(VAATI_REBORN, 2, i);
|
||||
if (entity != NULL) {
|
||||
entity->parent = this;
|
||||
}
|
||||
}
|
||||
entity = CreateNPC(VAATI_REBORN, 1, 0);
|
||||
entity->parent = this;
|
||||
entity->spriteOffsetY = -1;
|
||||
PositionRelative(this, entity, 0, 0x10000);
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 1:
|
||||
case 5:
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 2:
|
||||
if ((this->type2 & 2) != 0) {
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
}
|
||||
sub_0806B96C(this);
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 3:
|
||||
this->actionDelay = 1;
|
||||
this->field_0xf = 0x20;
|
||||
entity = CreateNPC(VAATI_REBORN, 4, 0);
|
||||
if (entity != NULL) {
|
||||
CopyPosition(this, entity);
|
||||
entity->parent = this;
|
||||
entity->spritePriority.b0 = this->spritePriority.b0 - 1;
|
||||
entity->frameIndex = 0;
|
||||
}
|
||||
entity = CreateNPC(VAATI_REBORN, 5, 0);
|
||||
if (entity != NULL) {
|
||||
CopyPosition(this, entity);
|
||||
entity->parent = this;
|
||||
entity->spritePriority.b0 = this->spritePriority.b0 + 1;
|
||||
}
|
||||
InitAnimationForceUpdate(this, 0);
|
||||
break;
|
||||
case 4:
|
||||
InitializeAnimation(this, 0);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void VaatiRebornAction1(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (CheckRoomFlag(3) == 0) {
|
||||
return;
|
||||
}
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
this->y.HALF.HI++;
|
||||
if (--this->actionDelay == 0) {
|
||||
entity = CreateNPC(VAATI_REBORN, 3, 0);
|
||||
if (entity == NULL) {
|
||||
break;
|
||||
}
|
||||
CopyPosition(this, entity);
|
||||
TextboxNoOverlapFollow(0x1634);
|
||||
this->subAction = this->subAction + 1;
|
||||
DeleteThisEntity();
|
||||
return;
|
||||
}
|
||||
if (this->field_0xf-- == 1) {
|
||||
this->field_0xf = 0x20;
|
||||
SoundReq(SFX_1A9);
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
break;
|
||||
case 1:
|
||||
entity = sub_0806B9BC(this);
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
PositionRelative(entity, this, 0, 0x210000);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
break;
|
||||
case 2:
|
||||
sub_0806B96C(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
break;
|
||||
case 3:
|
||||
switch (this->subAction) {
|
||||
case 0:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction += 1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (this->frames.b.f3 != 0) {
|
||||
this->subAction = 2;
|
||||
sub_0801D2B4(this, 0x13f);
|
||||
InitAnimationForceUpdate(this, this->subAction - 1);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ((this->frames.all & 0x10) != 0) {
|
||||
this->frames.all &= 0xef;
|
||||
|
||||
switch (++this->actionDelay) {
|
||||
case 1:
|
||||
break;
|
||||
case 10:
|
||||
this->subAction++;
|
||||
EnqueueSFX(SFX_SUMMON);
|
||||
this->actionDelay = 0;
|
||||
InitAnimationForceUpdate(this, this->subAction - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (this->frames.b.f3 != 0) {
|
||||
SetRoomFlag(0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (--this->field_0xf == 0) {
|
||||
this->field_0xf = 0x20;
|
||||
SoundReq(SFX_1A9);
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
break;
|
||||
default:
|
||||
entity = sub_0806B9BC(this);
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
break;
|
||||
}
|
||||
if (entity->subAction == 0) {
|
||||
break;
|
||||
}
|
||||
if (this->type != 4) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0806B96C(Entity* this) {
|
||||
Entity* entity;
|
||||
const xy* ptr;
|
||||
|
||||
entity = sub_0806B9BC(this);
|
||||
if (entity == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
ptr = &gUnk_08112F80[this->type2];
|
||||
this->spriteSettings.b.draw = entity->spriteSettings.b.draw;
|
||||
PositionRelative(entity, this, ptr->x << 0x10, (ptr->y + 0x21) << 0x10);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
Entity* sub_0806B9BC(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
entity = this->parent;
|
||||
if (entity != NULL && entity->next == NULL) {
|
||||
entity = NULL;
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#include "entity.h"
|
||||
#include "room.h"
|
||||
#include "player.h"
|
||||
#include "coord.h"
|
||||
|
||||
void ObjectB5(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
}
|
||||
#ifndef EU
|
||||
gRoomControls.cameraTarget = this;
|
||||
#endif
|
||||
PositionRelative(&gPlayerEntity, this, 0, -0x280000);
|
||||
}
|
||||
@@ -4,31 +4,29 @@
|
||||
#include "audio.h"
|
||||
#include "createObject.h"
|
||||
|
||||
extern void (*const gUnk_081299D0[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_081299E4[])(Entity*);
|
||||
|
||||
void sub_080A9488(Entity*);
|
||||
|
||||
void sub_080A94C0(Entity*, u32);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
|
||||
extern void (*const gArrowProjectile[])(Entity*);
|
||||
extern void (*const gArrowProjectileActions[])(Entity*);
|
||||
|
||||
typedef struct {
|
||||
u8 flipX;
|
||||
u8 flipY;
|
||||
u8 animIndex;
|
||||
u8 unk;
|
||||
Hitbox* hitbox;
|
||||
const Hitbox* hitbox;
|
||||
} struct_081299F8;
|
||||
extern struct_081299F8 gUnk_081299F8[];
|
||||
extern const struct_081299F8 gUnk_081299F8[];
|
||||
|
||||
void ProjectileD(Entity* this) {
|
||||
gUnk_081299D0[GetNextFunction(this)](this);
|
||||
void sub_080A9488(Entity*);
|
||||
void sub_080A94C0(Entity*, u32);
|
||||
|
||||
void ArrowProjectile(Entity* this) {
|
||||
gArrowProjectile[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A931C(Entity* this) {
|
||||
gUnk_081299E4[this->action](this);
|
||||
void ArrowProjectile_OnTick(Entity* this) {
|
||||
gArrowProjectileActions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9334(Entity* this) {
|
||||
@@ -44,7 +42,7 @@ void sub_080A9334(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9370(Entity* this) {
|
||||
void ArrowProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->flags &= 0x7f;
|
||||
@@ -54,10 +52,8 @@ void sub_080A9370(Entity* this) {
|
||||
sub_080A94C0(this, this->type);
|
||||
}
|
||||
|
||||
void sub_080A93A0(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
void ArrowProjectile_Action1(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if ((parent == NULL) || (parent->next == NULL)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -72,7 +68,7 @@ void sub_080A93A0(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A93DC(Entity* this) {
|
||||
void ArrowProjectile_Action2(Entity* this) {
|
||||
if (this->collisions != 0) {
|
||||
this->action = 3;
|
||||
this->flags &= 0x7f;
|
||||
@@ -86,14 +82,14 @@ void sub_080A93DC(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
}
|
||||
|
||||
void sub_080A942C(Entity* this) {
|
||||
void ArrowProjectile_Action3(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void sub_080A9448(Entity* this) {
|
||||
void ArrowProjectile_Action4(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x2800) == 0) {
|
||||
CreateDust(this);
|
||||
DeleteThisEntity();
|
||||
@@ -116,11 +112,32 @@ void sub_080A9488(Entity* this) {
|
||||
sub_080A94C0(this, this->animationState);
|
||||
}
|
||||
|
||||
void sub_080A94C0(Entity* this, u32 param) {
|
||||
struct_081299F8* entry = &gUnk_081299F8[param];
|
||||
void sub_080A94C0(Entity* this, u32 animationState) {
|
||||
const struct_081299F8* entry = &gUnk_081299F8[animationState];
|
||||
this->spriteSettings.b.flipX = entry->flipX;
|
||||
this->spriteSettings.b.flipY = entry->flipY;
|
||||
this->animIndex = entry->animIndex;
|
||||
this->hitbox = entry->hitbox;
|
||||
this->hitbox = (Hitbox*)entry->hitbox;
|
||||
InitializeAnimation(this, this->animIndex);
|
||||
}
|
||||
|
||||
void (*const gArrowProjectile[])(Entity*) = {
|
||||
ArrowProjectile_OnTick, sub_080A9334, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const gArrowProjectileActions[])(Entity*) = {
|
||||
ArrowProjectile_Init, ArrowProjectile_Action1, ArrowProjectile_Action2,
|
||||
ArrowProjectile_Action3, ArrowProjectile_Action4,
|
||||
};
|
||||
|
||||
extern const Hitbox gUnk_08129A18;
|
||||
extern const Hitbox gUnk_08129A20;
|
||||
|
||||
const struct_081299F8 gUnk_081299F8[] = {
|
||||
{ 0, 0, 1, 0, &gUnk_08129A20 },
|
||||
{ 1, 0, 0, 0, &gUnk_08129A18 },
|
||||
{ 0, 1, 1, 0, &gUnk_08129A20 },
|
||||
{ 0, 0, 0, 0, &gUnk_08129A18 },
|
||||
};
|
||||
|
||||
const Hitbox gUnk_08129A18 = { 0, 0, { 4, 0, 0, 0 }, 6, 4 };
|
||||
const Hitbox gUnk_08129A20 = { 0, 0, { 0, 0, 0, 4 }, 4, 6 };
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A494[])(Entity*);
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
bool32 sub_080AB12C(Entity* this);
|
||||
|
||||
void Projectile19(Entity* this) {
|
||||
extern void (*const gUnk_0812A494[])(Entity*);
|
||||
extern const u8 gUnk_0812A4A8[];
|
||||
|
||||
void BallAndChain(Entity* this) {
|
||||
gUnk_0812A494[this->type](this);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void sub_080AB074(Entity* this) {
|
||||
|
||||
this->height.HALF.HI += (s8)parent->field_0x7c.BYTES.byte3;
|
||||
if (parent->field_0x7a.HALF.HI != 0) {
|
||||
parent = sub_080A7EE0(0x19);
|
||||
parent = CreateProjectile(0x19);
|
||||
if (parent != NULL) {
|
||||
parent->type = 4;
|
||||
CopyPositionAndSpriteOffset(this, parent);
|
||||
@@ -49,19 +49,19 @@ bool32 sub_080AB12C(Entity* this) {
|
||||
if (gEntCount > 0x44) {
|
||||
return FALSE;
|
||||
}
|
||||
entity = sub_080A7EE0(0x19);
|
||||
entity = CreateProjectile(0x19);
|
||||
entity->type = 1;
|
||||
entity->parent = this;
|
||||
entity = sub_080A7EE0(0x19);
|
||||
entity = CreateProjectile(0x19);
|
||||
entity->type = 2;
|
||||
entity->parent = this;
|
||||
entity = sub_080A7EE0(0x19);
|
||||
entity = CreateProjectile(0x19);
|
||||
entity->type = 3;
|
||||
entity->parent = this;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile19/sub_080AB170.inc", void sub_080AB170(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/ballAndChain/sub_080AB170.inc", void sub_080AB170(Entity* this))
|
||||
|
||||
void sub_080AB26C(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
@@ -78,3 +78,11 @@ void sub_080AB26C(Entity* this) {
|
||||
this->frameIndex += 1;
|
||||
}
|
||||
}
|
||||
|
||||
void (*const gUnk_0812A494[])(Entity*) = {
|
||||
sub_080AB074, sub_080AB170, sub_080AB170, sub_080AB170, sub_080AB26C,
|
||||
};
|
||||
const u8 gUnk_0812A4A8[] = {
|
||||
6, 240, 10, 242, 10, 240, 8, 240, 252, 242, 248, 242, 252, 246, 4, 246,
|
||||
250, 242, 248, 240, 246, 242, 248, 244, 4, 242, 8, 242, 4, 246, 252, 246,
|
||||
};
|
||||
@@ -2,22 +2,21 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812960C[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129620[])(Entity*);
|
||||
|
||||
void sub_080A82D8(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
|
||||
void Projectile2(Entity* this) {
|
||||
gUnk_0812960C[GetNextFunction(this)](this);
|
||||
extern void (*const BoneProjectile_Functions[])(Entity*);
|
||||
extern void (*const BoneProjectile_Actions[])(Entity*);
|
||||
|
||||
void sub_080A82D8(Entity*);
|
||||
|
||||
void BoneProjectile(Entity* this) {
|
||||
BoneProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A81AC(Entity* this) {
|
||||
gUnk_08129620[this->action](this);
|
||||
void BoneProjectile_OnTick(Entity* this) {
|
||||
BoneProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A81C4(Entity* this) {
|
||||
@@ -28,14 +27,14 @@ void sub_080A81C4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A81E0(Entity* this) {
|
||||
void BoneProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x3c;
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void sub_080A81FC(Entity* this) {
|
||||
void BoneProjectile_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if (this->collisions == 0) {
|
||||
@@ -53,7 +52,7 @@ void sub_080A81FC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8248(Entity* this) {
|
||||
void BoneProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
@@ -64,7 +63,7 @@ void sub_080A8248(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A827C(Entity* this) {
|
||||
void BoneProjectile_Action3(Entity* this) {
|
||||
this->spriteSettings.b.draw ^= 1;
|
||||
sub_0806F69C(this);
|
||||
GetNextFrame(this);
|
||||
@@ -73,7 +72,7 @@ void sub_080A827C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A82B4(Entity* this) {
|
||||
void BoneProjectile_Action4(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_0806F69C(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
@@ -88,3 +87,10 @@ void sub_080A82D8(Entity* this) {
|
||||
this->direction ^= 0x10;
|
||||
this->speed = 0x80;
|
||||
}
|
||||
|
||||
void (*const BoneProjectile_Functions[])(Entity*) = {
|
||||
BoneProjectile_OnTick, sub_080A81C4, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const BoneProjectile_Actions[])(Entity*) = {
|
||||
BoneProjectile_Init, BoneProjectile_Action1, BoneProjectile_Action2, BoneProjectile_Action3, BoneProjectile_Action4,
|
||||
};
|
||||
@@ -0,0 +1,104 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void CreateItemOnGround(Entity*);
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern void sub_080043A8(Entity*);
|
||||
extern void CreateChestSpawner(Entity*);
|
||||
extern u32 sub_080177A0(Entity*, Entity*);
|
||||
|
||||
extern void (*const CannonballProjectile_Functions[])(Entity*);
|
||||
extern void (*const CannonballProjectile_Actions[])(Entity*);
|
||||
|
||||
bool32 sub_080AB5F4(Entity*);
|
||||
bool32 sub_080AB634(Entity*);
|
||||
|
||||
void CannonballProjectile(Entity* this) {
|
||||
CannonballProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void CannonballProjectile_OnTick(Entity* this) {
|
||||
CannonballProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AB544(Entity* this) {
|
||||
u32 tmp;
|
||||
|
||||
if (this->iframes < -4) {
|
||||
this->action = 2;
|
||||
this->direction = this->field_0x3e;
|
||||
tmp = (this->type ^ 2) << 3;
|
||||
if (this->direction - tmp + 1 < 3) {
|
||||
this->direction = tmp;
|
||||
}
|
||||
this->speed = 0x280;
|
||||
}
|
||||
}
|
||||
|
||||
void CannonballProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = this->type << 3;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
void CannonballProjectile_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) == 0) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_080AB5F4(this);
|
||||
}
|
||||
|
||||
void CannonballProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if ((sub_080AB634(this) == 0) && (this->collisions != 0)) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_080AB5F4(Entity* this) {
|
||||
switch (sub_080043E8(this)) {
|
||||
case 1:
|
||||
CreateItemOnGround(this);
|
||||
return TRUE;
|
||||
case 2:
|
||||
sub_080043A8(this);
|
||||
return TRUE;
|
||||
case 3:
|
||||
CreateChestSpawner(this);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 sub_080AB634(Entity* this) {
|
||||
Entity** entities = ((Entity**)&this->parent->field_0x20);
|
||||
u32 i;
|
||||
for (i = 0; i <= 3; ++i) {
|
||||
if (entities[i] != NULL && (sub_080177A0(this, entities[i]) != 0)) {
|
||||
if (entities[i]->action < 3) {
|
||||
entities[i]->action = 3;
|
||||
entities[i]->actionDelay = 0x1e;
|
||||
entities[i]->spriteSettings.b.draw = 0;
|
||||
CreateFx(entities[i], 0x45, 0);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void (*const CannonballProjectile_Functions[])(Entity*) = {
|
||||
CannonballProjectile_OnTick, sub_080AB544, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const CannonballProjectile_Actions[])(Entity*) = {
|
||||
CannonballProjectile_Init,
|
||||
CannonballProjectile_Action1,
|
||||
CannonballProjectile_Action2,
|
||||
};
|
||||
@@ -0,0 +1,188 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "coord.h"
|
||||
|
||||
extern const u8 DarkNutSwordSlash_DamageTypes[];
|
||||
extern void (*const DarkNutSwordSlash_UpdatesForType[])(Entity*);
|
||||
extern Hitbox const* const* const gUnk_081293E0[];
|
||||
extern const Hitbox* const gUnk_081293F0[];
|
||||
extern const Hitbox* const gUnk_08129400[];
|
||||
extern const Hitbox* const gUnk_08129410[];
|
||||
extern const Hitbox* const gUnk_08129420[];
|
||||
|
||||
void DarkNutSwordSlash_Init(Entity*);
|
||||
void DarkNutSwordSlash_OnTick(Entity*);
|
||||
|
||||
void DarkNutSwordSlash(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
DarkNutSwordSlash_Init(this);
|
||||
if (this->type == 3) {
|
||||
InitAnimationForceUpdate(this, this->parent->animationState + 0x18);
|
||||
}
|
||||
}
|
||||
if ((this->parent == NULL) || (this->parent->currentHealth == 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
this->iframes = -0x2d;
|
||||
}
|
||||
this->bitfield = 0;
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
DarkNutSwordSlash_OnTick(this);
|
||||
if (this->type == 3) {
|
||||
this->y.HALF.HI += 1;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_Init(Entity* this) {
|
||||
this->damageType = DarkNutSwordSlash_DamageTypes[this->parent->type + this->type * 4];
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_OnTick(Entity* this) {
|
||||
DarkNutSwordSlash_UpdatesForType[this->type](this);
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType0(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = (Hitbox*)gUnk_081293E0[parent->animationState][(parent->frames.all & 0xf) - 1];
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType2(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = (Hitbox*)gUnk_081293F0[parent->animationState];
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType34(Entity* this) {
|
||||
if ((this->parent->frames.all & 0x10) != 0) {
|
||||
this->hitbox = (Hitbox*)gUnk_08129410[this->parent->animationState];
|
||||
} else {
|
||||
this->hitbox = (Hitbox*)gUnk_08129400[this->parent->animationState];
|
||||
}
|
||||
}
|
||||
|
||||
void DarkNutSwordSlash_UpdateType1(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = (Hitbox*)gUnk_08129420[parent->animationState];
|
||||
}
|
||||
|
||||
const u8 DarkNutSwordSlash_DamageTypes[] = {
|
||||
76, 76, 78, 77, 83, 83, 83, 83, 79, 79, 76, 80, 84, 84, 84, 85, 79, 79, 76, 80,
|
||||
};
|
||||
void (*const DarkNutSwordSlash_UpdatesForType[])(Entity*) = {
|
||||
DarkNutSwordSlash_UpdateType0, DarkNutSwordSlash_UpdateType1, DarkNutSwordSlash_UpdateType2,
|
||||
DarkNutSwordSlash_UpdateType34, DarkNutSwordSlash_UpdateType34,
|
||||
};
|
||||
|
||||
extern const Hitbox* const gUnk_08129460[];
|
||||
extern const Hitbox* const gUnk_081294A8[];
|
||||
extern const Hitbox* const gUnk_081294F0[];
|
||||
extern const Hitbox* const gUnk_08129538[];
|
||||
Hitbox const* const* const gUnk_081293E0[] = {
|
||||
gUnk_08129460,
|
||||
gUnk_081294A8,
|
||||
gUnk_081294F0,
|
||||
gUnk_08129538,
|
||||
};
|
||||
extern const Hitbox gUnk_08129550;
|
||||
extern const Hitbox gUnk_08129558;
|
||||
extern const Hitbox gUnk_08129560;
|
||||
extern const Hitbox gUnk_08129568;
|
||||
const Hitbox* const gUnk_081293F0[] = {
|
||||
&gUnk_08129550,
|
||||
&gUnk_08129558,
|
||||
&gUnk_08129560,
|
||||
&gUnk_08129568,
|
||||
};
|
||||
extern const Hitbox gUnk_08129590;
|
||||
extern const Hitbox gUnk_081295A0;
|
||||
extern const Hitbox gUnk_081295B0;
|
||||
extern const Hitbox gUnk_081295C0;
|
||||
const Hitbox* const gUnk_08129400[] = {
|
||||
&gUnk_08129590,
|
||||
&gUnk_081295A0,
|
||||
&gUnk_081295B0,
|
||||
&gUnk_081295C0,
|
||||
};
|
||||
extern const Hitbox gUnk_08129598;
|
||||
extern const Hitbox gUnk_081295A8;
|
||||
extern const Hitbox gUnk_081295B8;
|
||||
extern const Hitbox gUnk_081295C8;
|
||||
const Hitbox* const gUnk_08129410[] = {
|
||||
&gUnk_08129598,
|
||||
&gUnk_081295A8,
|
||||
&gUnk_081295B8,
|
||||
&gUnk_081295C8,
|
||||
};
|
||||
extern const Hitbox gUnk_08129570;
|
||||
extern const Hitbox gUnk_08129578;
|
||||
extern const Hitbox gUnk_08129580;
|
||||
extern const Hitbox gUnk_08129588;
|
||||
const Hitbox* const gUnk_08129420[] = {
|
||||
&gUnk_08129570,
|
||||
&gUnk_08129578,
|
||||
&gUnk_08129580,
|
||||
&gUnk_08129588,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_08129430 = { -5, -32, { 0, 0, 0, 0 }, 8, 10 };
|
||||
const Hitbox gUnk_08129438 = { 2, -37, { 0, 0, 0, 0 }, 8, 10 };
|
||||
const Hitbox gUnk_08129440 = { 19, -33, { 0, 0, 0, 0 }, 10, 11 };
|
||||
const Hitbox gUnk_08129448 = { 28, -14, { 0, 0, 0, 0 }, 16, 6 };
|
||||
const Hitbox gUnk_08129450 = { 34, -18, { 0, 0, 0, 0 }, 8, 4 };
|
||||
const Hitbox gUnk_08129458 = { 25, 15, { 0, 0, 0, 0 }, 4, 4 };
|
||||
|
||||
const Hitbox* const gUnk_08129460[] = {
|
||||
&gUnk_08129430, &gUnk_08129438, &gUnk_08129440, &gUnk_08129448, &gUnk_08129450, &gUnk_08129458,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_08129478 = { 21, -6, { 0, 0, 0, 0 }, 12, 8 };
|
||||
const Hitbox gUnk_08129480 = { 21, -20, { 0, 0, 0, 0 }, 16, 8 };
|
||||
const Hitbox gUnk_08129488 = { 15, -31, { 0, 0, 0, 0 }, 8, 10 };
|
||||
const Hitbox gUnk_08129490 = { 3, -39, { 0, 0, 0, 0 }, 8, 12 };
|
||||
const Hitbox gUnk_08129498 = { 7, -38, { 0, 0, 0, 0 }, 7, 8 };
|
||||
const Hitbox gUnk_081294A0 = { 1, -29, { 0, 0, 0, 0 }, 4, 5 };
|
||||
|
||||
const Hitbox* const gUnk_081294A8[] = {
|
||||
&gUnk_08129478, &gUnk_08129480, &gUnk_08129488, &gUnk_08129490, &gUnk_08129498, &gUnk_081294A0,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_081294C0 = { 7, 7, { 0, 0, 0, 0 }, 8, 11 };
|
||||
const Hitbox gUnk_081294C8 = { -6, 10, { 0, 0, 0, 0 }, 8, 12 };
|
||||
const Hitbox gUnk_081294D0 = { -22, 2, { 0, 0, 0, 0 }, 8, 8 };
|
||||
const Hitbox gUnk_081294D8 = { -27, -11, { 0, 0, 0, 0 }, 12, 8 };
|
||||
const Hitbox gUnk_081294E0 = { -28, -9, { 0, 0, 0, 0 }, 15, 6 };
|
||||
const Hitbox gUnk_081294E8 = { -21, -12, { 0, 0, 0, 0 }, 6, 2 };
|
||||
|
||||
const Hitbox* const gUnk_081294F0[] = {
|
||||
&gUnk_081294C0, &gUnk_081294C8, &gUnk_081294D0, &gUnk_081294D8, &gUnk_081294E0, &gUnk_081294E8,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_08129508 = { -21, -6, { 0, 0, 0, 0 }, 12, 8 };
|
||||
const Hitbox gUnk_08129510 = { -21, -20, { 0, 0, 0, 0 }, 16, 8 };
|
||||
const Hitbox gUnk_08129518 = { -15, -31, { 0, 0, 0, 0 }, 8, 10 };
|
||||
const Hitbox gUnk_08129520 = { -3, -39, { 0, 0, 0, 0 }, 8, 12 };
|
||||
const Hitbox gUnk_08129528 = { -7, -38, { 0, 0, 0, 0 }, 7, 8 };
|
||||
const Hitbox gUnk_08129530 = { -1, -29, { 0, 0, 0, 0 }, 4, 5 };
|
||||
|
||||
const Hitbox* const gUnk_08129538[] = {
|
||||
&gUnk_08129508, &gUnk_08129510, &gUnk_08129518, &gUnk_08129520, &gUnk_08129528, &gUnk_08129530,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_08129550 = { 3, -30, { 0, 0, 0, 0 }, 7, 10 };
|
||||
const Hitbox gUnk_08129558 = { 28, -12, { 0, 0, 0, 0 }, 14, 7 };
|
||||
const Hitbox gUnk_08129560 = { -2, 14, { 0, 0, 0, 0 }, 12, 7 };
|
||||
const Hitbox gUnk_08129568 = { -28, -12, { 0, 0, 0, 0 }, 14, 7 };
|
||||
const Hitbox gUnk_08129570 = { 1, -29, { 0, 0, 0, 0 }, 8, 8 };
|
||||
const Hitbox gUnk_08129578 = { 19, -8, { 0, 0, 0, 0 }, 8, 8 };
|
||||
const Hitbox gUnk_08129580 = { 0, 10, { 0, 0, 0, 0 }, 8, 8 };
|
||||
const Hitbox gUnk_08129588 = { -19, -8, { 0, 0, 0, 0 }, 8, 8 };
|
||||
const Hitbox gUnk_08129590 = { 4, -37, { 0, 0, 0, 0 }, 7, 10 };
|
||||
const Hitbox gUnk_08129598 = { 4, -35, { 0, 0, 0, 0 }, 2, 8 };
|
||||
const Hitbox gUnk_081295A0 = { 32, -14, { 0, 0, 0, 0 }, 14, 6 };
|
||||
const Hitbox gUnk_081295A8 = { 30, -14, { 0, 0, 0, 0 }, 12, 2 };
|
||||
const Hitbox gUnk_081295B0 = { -1, 22, { 0, 0, 0, 0 }, 7, 12 };
|
||||
const Hitbox gUnk_081295B8 = { -1, 20, { 0, 0, 0, 0 }, 2, 10 };
|
||||
const Hitbox gUnk_081295C0 = { -32, -14, { 0, 0, 0, 0 }, 14, 6 };
|
||||
const Hitbox gUnk_081295C8 = { -30, -14, { 0, 0, 0, 0 }, 12, 2 };
|
||||
@@ -4,24 +4,23 @@
|
||||
#include "audio.h"
|
||||
#include "flags.h"
|
||||
|
||||
extern void (*const gUnk_081296F0[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129704[])(Entity*);
|
||||
|
||||
void sub_080A8680(Entity*);
|
||||
void sub_080A86A0(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
extern u32 sub_080177A0(Entity*, Entity*);
|
||||
|
||||
void Projectile4(Entity* this) {
|
||||
gUnk_081296F0[GetNextFunction(this)](this);
|
||||
extern void (*const DekuSeedProjectile_Functions[])(Entity*);
|
||||
extern void (*const DekuSeedProjectile_Actions[])(Entity*);
|
||||
|
||||
void sub_080A8680(Entity*);
|
||||
void sub_080A86A0(Entity*);
|
||||
|
||||
void DekuSeedProjectile(Entity* this) {
|
||||
DekuSeedProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A8458(Entity* this) {
|
||||
gUnk_08129704[this->action](this);
|
||||
void DekuSeedProjectile_OnTick(Entity* this) {
|
||||
DekuSeedProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8470(Entity* this) {
|
||||
@@ -41,7 +40,7 @@ void sub_080A8470(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A84C8(Entity* this) {
|
||||
void DekuSeedProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x30;
|
||||
this->field_0xf = 0;
|
||||
@@ -53,7 +52,7 @@ void sub_080A84C8(Entity* this) {
|
||||
InitializeAnimation(this, 0x18);
|
||||
}
|
||||
|
||||
void sub_080A8504(Entity* this) {
|
||||
void DekuSeedProjectile_Action1(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
GetNextFrame(this);
|
||||
@@ -88,7 +87,7 @@ void sub_080A8504(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A85B8(Entity* this) {
|
||||
void DekuSeedProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) != 0) {
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -106,14 +105,14 @@ void sub_080A85B8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8610(Entity* this) {
|
||||
void DekuSeedProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A862C(Entity* this) {
|
||||
void DekuSeedProjectile_Action4(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
switch (sub_080044EC(this, 0x2800)) {
|
||||
@@ -145,3 +144,11 @@ void sub_080A86A0(Entity* this) {
|
||||
this->speed = 0;
|
||||
EnqueueSFX(SFX_18E);
|
||||
}
|
||||
|
||||
void (*const DekuSeedProjectile_Functions[])(Entity*) = {
|
||||
DekuSeedProjectile_OnTick, sub_080A8470, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const DekuSeedProjectile_Actions[])(Entity*) = {
|
||||
DekuSeedProjectile_Init, DekuSeedProjectile_Action1, DekuSeedProjectile_Action2,
|
||||
DekuSeedProjectile_Action3, DekuSeedProjectile_Action4,
|
||||
};
|
||||
@@ -4,19 +4,17 @@
|
||||
#include "coord.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_08129740[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129754[])(Entity*);
|
||||
|
||||
extern Hitbox gUnk_08129764;
|
||||
|
||||
extern void sub_08078954(Entity*);
|
||||
|
||||
void Projectile6(Entity* this) {
|
||||
gUnk_08129740[GetNextFunction(this)](this);
|
||||
extern void (*const DirtBallProjectile_Functions[])(Entity*);
|
||||
extern void (*const DirtBallProjectile_Actions[])(Entity*);
|
||||
extern const Hitbox3D gUnk_08129764;
|
||||
|
||||
void DirtBallProjectile(Entity* this) {
|
||||
DirtBallProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A87E4(Entity* this) {
|
||||
void DirtBallProjectile_OnTick(Entity* this) {
|
||||
if (this->type == 1) {
|
||||
if (this->attachedEntity == NULL) {
|
||||
DeleteThisEntity();
|
||||
@@ -25,7 +23,7 @@ void sub_080A87E4(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
gUnk_08129754[this->action](this);
|
||||
DirtBallProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A881C(Entity* this) {
|
||||
@@ -45,12 +43,12 @@ void sub_080A881C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8868(Entity* this) {
|
||||
void DirtBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->subAction = 0;
|
||||
this->spriteSettings.b.shadow = 1;
|
||||
this->field_0x20 = 0x8000;
|
||||
this->hitbox = &gUnk_08129764;
|
||||
this->hitbox = (Hitbox*)&gUnk_08129764;
|
||||
this->field_0x3c |= 0x10;
|
||||
switch (this->type) {
|
||||
case 0:
|
||||
@@ -66,7 +64,7 @@ void sub_080A8868(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A88C8(Entity* this) {
|
||||
void DirtBallProjectile_Action1(Entity* this) {
|
||||
Entity* entity;
|
||||
Entity* parent;
|
||||
|
||||
@@ -106,7 +104,7 @@ void sub_080A88C8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8988(Entity* this) {
|
||||
void DirtBallProjectile_Action2(Entity* this) {
|
||||
u8 bVar1;
|
||||
u32 uVar2;
|
||||
u32 tmp;
|
||||
@@ -160,9 +158,20 @@ void sub_080A8988(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8A48(Entity* this) {
|
||||
void DirtBallProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void (*const DirtBallProjectile_Functions[])(Entity*) = {
|
||||
DirtBallProjectile_OnTick, sub_080A881C, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const DirtBallProjectile_Actions[])(Entity*) = {
|
||||
DirtBallProjectile_Init,
|
||||
DirtBallProjectile_Action1,
|
||||
DirtBallProjectile_Action2,
|
||||
DirtBallProjectile_Action3,
|
||||
};
|
||||
const Hitbox3D gUnk_08129764 = { 0, -3, { 5, 3, 3, 5 }, 6, 6, 10, { 0, 0, 0 } };
|
||||
@@ -4,20 +4,20 @@
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0812982C[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
|
||||
void Projectile8(Entity* this) {
|
||||
extern void (*const FireProjectile_Actions[])(Entity*);
|
||||
|
||||
void FireProjectile(Entity* this) {
|
||||
if (GetNextFunction(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_0812982C[this->action](this);
|
||||
FireProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8BC0(Entity* this) {
|
||||
void FireProjectile_Init(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->direction >> 3);
|
||||
@@ -28,11 +28,9 @@ void sub_080A8BC0(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8BF8(Entity* this) {
|
||||
void FireProjectile_Action1(Entity* this) {
|
||||
u32 direction;
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
Entity* parent = this->parent;
|
||||
if (parent == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
@@ -53,7 +51,7 @@ void sub_080A8BF8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8C4C(Entity* this) {
|
||||
void FireProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) != 0) {
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -68,9 +66,16 @@ void sub_080A8C4C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8C8C(Entity* this) {
|
||||
void FireProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void (*const FireProjectile_Actions[])(Entity*) = {
|
||||
FireProjectile_Init,
|
||||
FireProjectile_Action1,
|
||||
FireProjectile_Action2,
|
||||
FireProjectile_Action3,
|
||||
};
|
||||
@@ -6,33 +6,31 @@
|
||||
#include "random.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_08129954[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129968[])(Entity*);
|
||||
|
||||
void sub_080A90D8(Entity*);
|
||||
|
||||
extern void sub_0806F5BC(Entity*, u32, u32);
|
||||
extern u32 sub_080041DC(Entity*, u32, u32);
|
||||
|
||||
extern s8 gUnk_08129978[];
|
||||
extern s8 gUnk_08129980[];
|
||||
extern s8 gUnk_08129988[];
|
||||
extern void (*const GleerokProjectile_Functions[])(Entity*);
|
||||
extern void (*const GleerokProjectile_Actions[])(Entity*);
|
||||
extern const s8 gUnk_08129978[];
|
||||
extern const s8 gUnk_08129980[];
|
||||
extern const s8 gUnk_08129988[];
|
||||
|
||||
void ProjectileA(Entity* this) {
|
||||
gUnk_08129954[GetNextFunction(this)](this);
|
||||
void sub_080A90D8(Entity*);
|
||||
|
||||
void GleerokProjectile(Entity* this) {
|
||||
GleerokProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A8DDC(Entity* this) {
|
||||
void GleerokProjectile_OnTick(Entity* this) {
|
||||
if (((this->type != 3) && ((this->bitfield & 0x80) != 0)) && ((this->bitfield & 0x7f) != 0x1e)) {
|
||||
this->action = 3;
|
||||
this->flags &= 0x7f;
|
||||
InitializeAnimation(this, 0x53);
|
||||
}
|
||||
gUnk_08129968[this->action](this);
|
||||
GleerokProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8E28(Entity* this) {
|
||||
void GleerokProjectile_Init(Entity* this) {
|
||||
u32 uVar1;
|
||||
s32 iVar2;
|
||||
|
||||
@@ -88,7 +86,7 @@ void sub_080A8E28(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8FB8(Entity* this) {
|
||||
void GleerokProjectile_Action1(Entity* this) {
|
||||
if (this->type == 3) {
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
sub_08008790(this, 7);
|
||||
@@ -115,7 +113,7 @@ void sub_080A8FB8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9058(Entity* this) {
|
||||
void GleerokProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->type == 2) {
|
||||
if (--this->actionDelay == 0xff) {
|
||||
@@ -135,7 +133,7 @@ void sub_080A9058(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A90BC(Entity* this) {
|
||||
void GleerokProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
@@ -153,3 +151,16 @@ void sub_080A90D8(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void (*const GleerokProjectile_Functions[])(Entity*) = {
|
||||
GleerokProjectile_OnTick, GleerokProjectile_OnTick, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const GleerokProjectile_Actions[])(Entity*) = {
|
||||
GleerokProjectile_Init,
|
||||
GleerokProjectile_Action1,
|
||||
GleerokProjectile_Action2,
|
||||
GleerokProjectile_Action3,
|
||||
};
|
||||
const s8 gUnk_08129978[] = { 80, 0, 0, 80, -96, 0, 0, -96 };
|
||||
const s8 gUnk_08129980[] = { 0, 16, -16, 0, 16, -16, 16, -16 };
|
||||
const s8 gUnk_08129988[] = { 0, -16, -32, -48, -64, -80, -96, -112, 0, 16, 32, 48, 64, 80, 96, 112 };
|
||||
@@ -3,13 +3,14 @@
|
||||
#include "coord.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern Hitbox gUnk_080FD1E4;
|
||||
extern u32 sub_080644C8(Entity*);
|
||||
extern u8 gUnk_081299C8[];
|
||||
extern bool32 sub_080AE4CC(Entity*, u32, u32, u32);
|
||||
extern Entity gUnk_02027EB4;
|
||||
extern const Hitbox gUnk_080FD1E4;
|
||||
|
||||
void ProjectileC(Entity* this) {
|
||||
extern const u8 gUnk_081299C8[];
|
||||
|
||||
void GuardLineOfSight(Entity* this) {
|
||||
Entity* entity;
|
||||
u8 tmp;
|
||||
|
||||
@@ -31,7 +32,7 @@ void ProjectileC(Entity* this) {
|
||||
} else {
|
||||
if (sub_080644C8(this) != 0) {
|
||||
if (((this->actionDelay++) & 3) == 0) {
|
||||
entity = sub_080A7EE0(0xc);
|
||||
entity = CreateProjectile(0xc);
|
||||
if (entity != NULL) {
|
||||
entity->type = 1;
|
||||
tmp = this->parent->field_0x3e;
|
||||
@@ -48,7 +49,7 @@ void ProjectileC(Entity* this) {
|
||||
this->actionDelay = 0x12;
|
||||
this->spriteSettings.b.draw = 0;
|
||||
this->speed = 0x800;
|
||||
this->hitbox = &gUnk_080FD1E4;
|
||||
this->hitbox = (Hitbox*)&gUnk_080FD1E4;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
if (this->bitfield == 0x80) {
|
||||
@@ -66,3 +67,7 @@ void ProjectileC(Entity* this) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const u8 gUnk_081299C8[] = {
|
||||
0, 254, 0, 254, 0, 2, 0, 2,
|
||||
};
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
void sub_080AABB0(Entity*);
|
||||
|
||||
void Projectile17(Entity* this) {
|
||||
void GuruguruBarProjectile(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
@@ -4,35 +4,34 @@
|
||||
#include "player.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0812A9D8[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A9EC[])(Entity*);
|
||||
|
||||
void sub_080AC954(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void Projectile23(Entity* this) {
|
||||
gUnk_0812A9D8[GetNextFunction(this)](this);
|
||||
extern void (*const GyorgMaleEnergyProjectile_Functions[])(Entity*);
|
||||
extern void (*const GyorgMaleEnergyProjectile_Actions[])(Entity*);
|
||||
|
||||
void GyorgMaleEnergyProjectile_Action1(Entity*);
|
||||
|
||||
void GyorgMaleEnergyProjectile(Entity* this) {
|
||||
GyorgMaleEnergyProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AC8C4(Entity* this) {
|
||||
gUnk_0812A9EC[this->action](this);
|
||||
void GyorgMaleEnergyProjectile_OnTick(Entity* this) {
|
||||
GyorgMaleEnergyProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile23/sub_080AC8DC.inc", void sub_080AC8DC(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/gyorgMaleEnergyProjectile/sub_080AC8DC.inc", void sub_080AC8DC(Entity* this))
|
||||
|
||||
void sub_080AC928(Entity* this) {
|
||||
void GyorgMaleEnergyProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x3c;
|
||||
this->collisionLayer = 2;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
InitializeAnimation(this, 0);
|
||||
sub_080AC954(this);
|
||||
GyorgMaleEnergyProjectile_Action1(this);
|
||||
}
|
||||
|
||||
void sub_080AC954(Entity* this) {
|
||||
void GyorgMaleEnergyProjectile_Action1(Entity* this) {
|
||||
u32 animationState;
|
||||
|
||||
if (this->parent->next == NULL) {
|
||||
@@ -50,7 +49,7 @@ void sub_080AC954(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AC9CC(Entity* this) {
|
||||
void GyorgMaleEnergyProjectile_Action2(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
GetNextFrame(this);
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -64,10 +63,20 @@ void sub_080AC9CC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080ACA14(Entity* this) {
|
||||
void GyorgMaleEnergyProjectile_Action3(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void (*const GyorgMaleEnergyProjectile_Functions[])(Entity*) = {
|
||||
GyorgMaleEnergyProjectile_OnTick, sub_080AC8DC, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const GyorgMaleEnergyProjectile_Actions[])(Entity*) = {
|
||||
GyorgMaleEnergyProjectile_Init,
|
||||
GyorgMaleEnergyProjectile_Action1,
|
||||
GyorgMaleEnergyProjectile_Action2,
|
||||
GyorgMaleEnergyProjectile_Action3,
|
||||
};
|
||||
@@ -4,27 +4,25 @@
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A9A8[])(Entity*);
|
||||
|
||||
extern u16 gUnk_0812A9B4[];
|
||||
bool32 sub_080AC5E4(Entity*);
|
||||
void sub_080AC388(Entity*);
|
||||
|
||||
extern u8 gUnk_0812A9BA[];
|
||||
extern u8 gEntCount;
|
||||
extern Hitbox gUnk_080FD458;
|
||||
|
||||
extern Hitbox gUnk_080FD168;
|
||||
extern Hitbox gUnk_080FD448;
|
||||
|
||||
extern void (*const gUnk_0812A994[])(Entity*);
|
||||
extern void (*const GyorgTail_Actions[])(Entity*);
|
||||
extern const s16 gUnk_0812A9B4[];
|
||||
extern const u8 gUnk_0812A9B8[];
|
||||
extern const u8 gUnk_0812A9BA[];
|
||||
extern const u8 gUnk_0812A9C0[];
|
||||
|
||||
bool32 sub_080AC5E4(Entity*);
|
||||
void sub_080AC388(Entity*);
|
||||
void sub_080AC6F0(Entity*);
|
||||
void sub_080AC760(Entity*);
|
||||
void sub_080AC7C4(Entity*);
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
void Projectile22(Entity* this) {
|
||||
void GyorgTail(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->parent->next == NULL) {
|
||||
@@ -50,10 +48,10 @@ void Projectile22(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080AC328(Entity* this) {
|
||||
gUnk_0812A9A8[this->action](this);
|
||||
GyorgTail_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AC340(Entity* this) {
|
||||
void GyorgTail_Init(Entity* this) {
|
||||
if (sub_080AC5E4(this) != 0) {
|
||||
this->action = 1;
|
||||
this->frameIndex = 0xc;
|
||||
@@ -64,7 +62,7 @@ void sub_080AC340(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile22/sub_080AC388.inc", void sub_080AC388(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC388.inc", void sub_080AC388(Entity* this))
|
||||
|
||||
void sub_080AC480(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
@@ -126,7 +124,7 @@ void sub_080AC560(Entity* this) {
|
||||
this->y.WORD = entity->y.WORD - gSineTable[entity->direction + 0x40] * factor;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/projectile22/sub_080AC5E4.inc", bool32 sub_080AC5E4(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/gyorgTail/sub_080AC5E4.inc", bool32 sub_080AC5E4(Entity* this)) {
|
||||
// TODO regalloc
|
||||
Entity* entity;
|
||||
Entity* entity2;
|
||||
@@ -139,20 +137,20 @@ NONMATCH("asm/non_matching/projectile22/sub_080AC5E4.inc", bool32 sub_080AC5E4(E
|
||||
return 0;
|
||||
}
|
||||
this->field_0x78.HALF.HI = 0x11;
|
||||
entity = sub_080A7EE0(0x22);
|
||||
entity = CreateProjectile(0x22);
|
||||
entity->type = this->type;
|
||||
entity->type2 = 1;
|
||||
entity->parent = this->parent;
|
||||
entity->field_0x78.HALF.HI = 0x12;
|
||||
this->attachedEntity = entity;
|
||||
entity2 = sub_080A7EE0(0x22);
|
||||
entity2 = CreateProjectile(0x22);
|
||||
entity2->type = this->type;
|
||||
entity2->type2 = 2;
|
||||
entity2->parent = this->parent;
|
||||
entity2->field_0x78.HALF.HI = 0x14;
|
||||
uVar3 = entity2->field_0x78.HALF.HI;
|
||||
entity->attachedEntity = entity2;
|
||||
entity3 = sub_080A7EE0(0x22);
|
||||
entity3 = CreateProjectile(0x22);
|
||||
entity3->type = this->type;
|
||||
entity3->type2 = 3;
|
||||
entity3->parent = this->parent;
|
||||
@@ -164,14 +162,14 @@ NONMATCH("asm/non_matching/projectile22/sub_080AC5E4.inc", bool32 sub_080AC5E4(E
|
||||
return 0;
|
||||
}
|
||||
this->field_0x78.HALF.HI = 0xf;
|
||||
entity = sub_080A7EE0(0x22);
|
||||
entity = CreateProjectile(0x22);
|
||||
entity->type = this->type;
|
||||
entity->type2 = 1;
|
||||
entity->parent = this->parent;
|
||||
entity->field_0x78.HALF.HI = 0x10;
|
||||
uVar3 = entity->field_0x78.HALF.HI;
|
||||
this->attachedEntity = entity;
|
||||
entity2 = sub_080A7EE0(0x22);
|
||||
entity2 = CreateProjectile(0x22);
|
||||
entity2->type = this->type;
|
||||
entity2->type2 = 2;
|
||||
entity2->parent = this->parent;
|
||||
@@ -179,7 +177,7 @@ NONMATCH("asm/non_matching/projectile22/sub_080AC5E4.inc", bool32 sub_080AC5E4(E
|
||||
entity2->field_0x78.HALF.HI = 0x20;
|
||||
entity->attachedEntity = entity2;
|
||||
}
|
||||
entity4 = sub_080A7EE0(0x22);
|
||||
entity4 = CreateProjectile(0x22);
|
||||
entity4->type = this->type;
|
||||
entity4->type2 = 4;
|
||||
entity4->parent = this->parent;
|
||||
@@ -189,11 +187,11 @@ NONMATCH("asm/non_matching/projectile22/sub_080AC5E4.inc", bool32 sub_080AC5E4(E
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile22/sub_080AC6F0.inc", void sub_080AC6F0(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC6F0.inc", void sub_080AC6F0(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile22/sub_080AC760.inc", void sub_080AC760(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/gyorgTail/sub_080AC760.inc", void sub_080AC760(Entity* this))
|
||||
|
||||
NONMATCH("asm/non_matching/projectile22/sub_080AC7C4.inc", void sub_080AC7C4(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/gyorgTail/sub_080AC7C4.inc", void sub_080AC7C4(Entity* this)) {
|
||||
// TODO regalloc
|
||||
Entity* entity1;
|
||||
Entity* entity2;
|
||||
@@ -227,3 +225,16 @@ void sub_080AC884(Entity* this) {
|
||||
this->field_0xf = 0x56;
|
||||
}
|
||||
}
|
||||
|
||||
void (*const gUnk_0812A994[])(Entity*) = {
|
||||
sub_080AC328, sub_080AC510, sub_080AC510, sub_080AC510, sub_080AC560,
|
||||
};
|
||||
void (*const GyorgTail_Actions[])(Entity*) = {
|
||||
GyorgTail_Init,
|
||||
sub_080AC388,
|
||||
sub_080AC480,
|
||||
};
|
||||
const s16 gUnk_0812A9B4[] = { -64, 64 };
|
||||
const u8 gUnk_0812A9B8[] = { 24, 20 };
|
||||
const u8 gUnk_0812A9BA[] = { 24, 25, 25, 24, 24, 24 };
|
||||
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 };
|
||||
@@ -4,20 +4,20 @@
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_081298B8[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
|
||||
void Projectile9(Entity* this) {
|
||||
extern void (*const IceProjectile_Actions[])(Entity*);
|
||||
|
||||
void IceProjectile(Entity* this) {
|
||||
if (GetNextFunction(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_081298B8[this->action](this);
|
||||
IceProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8CD4(Entity* this) {
|
||||
void IceProjectile_Init(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->direction >> 3);
|
||||
@@ -28,7 +28,7 @@ void sub_080A8CD4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8D0C(Entity* this) {
|
||||
void IceProjectile_Action1(Entity* this) {
|
||||
u32 direction;
|
||||
Entity* parent;
|
||||
|
||||
@@ -53,7 +53,7 @@ void sub_080A8D0C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8D60(Entity* this) {
|
||||
void IceProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) != 0) {
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -68,9 +68,16 @@ void sub_080A8D60(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8DA0(Entity* this) {
|
||||
void IceProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void (*const IceProjectile_Actions[])(Entity*) = {
|
||||
IceProjectile_Init,
|
||||
IceProjectile_Action1,
|
||||
IceProjectile_Action2,
|
||||
IceProjectile_Action3,
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "coord.h"
|
||||
|
||||
extern void sub_0803C0AC(Entity*);
|
||||
|
||||
extern const Hitbox* const gUnk_08129998[];
|
||||
|
||||
void KeatonDagger(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
}
|
||||
parent = this->parent;
|
||||
if (((parent == NULL) || (parent->currentHealth == 0)) || (parent->next == NULL)) {
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
sub_0803C0AC(this);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
this->hitbox = (Hitbox*)gUnk_08129998[parent->animationState];
|
||||
CopyPosition(parent, this);
|
||||
if ((parent->iframes != 0) && (this->iframes == 0)) {
|
||||
this->iframes = 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern const Hitbox gUnk_081299A8;
|
||||
extern const Hitbox gUnk_081299B0;
|
||||
extern const Hitbox gUnk_081299B8;
|
||||
extern const Hitbox gUnk_081299C0;
|
||||
|
||||
const Hitbox* const gUnk_08129998[] = {
|
||||
&gUnk_081299A8,
|
||||
&gUnk_081299B0,
|
||||
&gUnk_081299B8,
|
||||
&gUnk_081299C0,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_081299A8 = { 4, -16, { 0, 0, 0, 0 }, 2, 3 };
|
||||
const Hitbox gUnk_081299B0 = { 9, -2, { 0, 0, 0, 0 }, 3, 2 };
|
||||
const Hitbox gUnk_081299B8 = { -4, 1, { 0, 0, 0, 0 }, 2, 3 };
|
||||
const Hitbox gUnk_081299C0 = { -9, -2, { 0, 0, 0, 0 }, 3, 3 };
|
||||
@@ -0,0 +1,77 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
extern void sub_08079D84(void);
|
||||
|
||||
extern void (*const LakituCloudProjectile_Functions[])(Entity*);
|
||||
extern void (*const LakituCloudProjectile_Actions[])(Entity*);
|
||||
extern void (*const LakituCloudProjectile_SubActions[])(Entity*);
|
||||
|
||||
void LakituCloudProjectile(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
LakituCloudProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_OnTick(Entity* this) {
|
||||
LakituCloudProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void nullsub_539(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080A9CF0(Entity* this) {
|
||||
if (sub_0806F520() == 0) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
LakituCloudProjectile_SubActions[this->subAction](this);
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_SubAction0(Entity* this) {
|
||||
this->subAction = 2;
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_SubAction1(Entity* this) {
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_SubAction2(Entity* this) {
|
||||
if (sub_0806F3E4(this) != 0) {
|
||||
if (this->damageType == 0xa6) {
|
||||
ModHealth(-2);
|
||||
sub_0800449C(&gPlayerEntity, 0x7a);
|
||||
sub_08079D84();
|
||||
}
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->animationState = this->parent->animationState;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
void LakituCloudProjectile_Action1(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void (*const LakituCloudProjectile_Functions[])(Entity*) = {
|
||||
LakituCloudProjectile_OnTick, nullsub_539, DeleteEntity, DeleteEntity, DeleteEntity, sub_080A9CF0,
|
||||
};
|
||||
void (*const LakituCloudProjectile_Actions[])(Entity*) = {
|
||||
LakituCloudProjectile_Init,
|
||||
LakituCloudProjectile_Action1,
|
||||
};
|
||||
void (*const LakituCloudProjectile_SubActions[])(Entity*) = {
|
||||
LakituCloudProjectile_SubAction0,
|
||||
LakituCloudProjectile_SubAction1,
|
||||
LakituCloudProjectile_SubAction2,
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
extern void (*const LakituLightning_Functions[])(Entity*);
|
||||
extern void (*const LakituLightning_Actions[])(Entity*);
|
||||
|
||||
void LakituLightning_OnTick(Entity*);
|
||||
|
||||
void LakituLightning(Entity* this) {
|
||||
LakituLightning_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void LakituLightning_OnTick(Entity* this) {
|
||||
LakituLightning_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9DD8(Entity* this) {
|
||||
if ((this->currentHealth == 0) || (this->bitfield == 0x80)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
LakituLightning_OnTick(this);
|
||||
}
|
||||
|
||||
void LakituLightning_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xb4;
|
||||
this->currentHealth = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void LakituLightning_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if ((this->collisions != 0) || (--this->actionDelay == 0)) {
|
||||
CreateFx(this, 0x4f, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void (*const LakituLightning_Functions[])(Entity*) = {
|
||||
LakituLightning_OnTick, sub_080A9DD8, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const LakituLightning_Actions[])(Entity*) = {
|
||||
LakituLightning_Init,
|
||||
LakituLightning_Action1,
|
||||
};
|
||||
@@ -6,51 +6,42 @@
|
||||
#include "random.h"
|
||||
#include "game.h"
|
||||
|
||||
extern void (*const gUnk_08129C7C[])(Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern u32 sub_08049F1C(Entity*, Entity*, u32);
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern u32 sub_0806F824(Entity*, Entity*, u32, u32);
|
||||
extern Hitbox gUnk_080FD150;
|
||||
|
||||
extern void (*const MandiblesProjectile_Functions[])(Entity*);
|
||||
extern void (*const MandiblesProjectile_Actions[])(Entity*);
|
||||
extern const u8 gUnk_08129CA4[];
|
||||
extern const Hitbox* const gUnk_08129CF4[];
|
||||
extern const u8 gUnk_08129CAC[];
|
||||
extern const s8 gUnk_08129D14[];
|
||||
|
||||
extern void (*const gUnk_08129C90[])(Entity*);
|
||||
void sub_080AA1D8(Entity*);
|
||||
|
||||
void sub_080AA270(Entity*);
|
||||
|
||||
bool32 sub_080AA2E0(Entity*);
|
||||
void sub_080AA320(Entity*);
|
||||
|
||||
void sub_080AA3E0(Entity*, u32);
|
||||
bool32 sub_080AA374(Entity*);
|
||||
|
||||
extern u8 gUnk_08129CA4[];
|
||||
extern Hitbox* gUnk_08129CF4[];
|
||||
extern u8 gUnk_08129CAC[];
|
||||
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
extern u32 sub_08049F1C(Entity*, Entity*, u32);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
|
||||
extern Hitbox gUnk_080FD150;
|
||||
|
||||
extern s8 gUnk_08129D14[];
|
||||
extern u32 sub_0806F824(Entity*, Entity*, u32, u32);
|
||||
|
||||
void Projectile13(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
entity = this->attachedEntity;
|
||||
void MandiblesProjectile(Entity* this) {
|
||||
Entity* entity = this->attachedEntity;
|
||||
if (entity == NULL) {
|
||||
entity = this->parent;
|
||||
}
|
||||
if ((entity->field_0x43 == 0) && ((this->flags & 0x80) == 0)) {
|
||||
this->flags |= 0x80;
|
||||
}
|
||||
gUnk_08129C7C[GetNextFunction(this)](this);
|
||||
MandiblesProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A9E94(Entity* this) {
|
||||
void MandiblesProjectile_OnTick(Entity* this) {
|
||||
if (this->action < 3) {
|
||||
sub_080AA1D8(this);
|
||||
}
|
||||
gUnk_08129C90[this->action](this);
|
||||
MandiblesProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9EBC(Entity* this) {
|
||||
@@ -86,7 +77,7 @@ void sub_080A9EBC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9F50(Entity* this) {
|
||||
void MandiblesProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x80.HWORD = 0;
|
||||
this->animationState = 0xff;
|
||||
@@ -96,7 +87,7 @@ void sub_080A9F50(Entity* this) {
|
||||
sub_080AA270(this);
|
||||
}
|
||||
|
||||
void sub_080A9F90(Entity* this) {
|
||||
void MandiblesProjectile_Action1(Entity* this) {
|
||||
if (this->field_0x80.HWORD != 0) {
|
||||
this->field_0x80.HWORD -= 1;
|
||||
} else {
|
||||
@@ -111,7 +102,7 @@ void sub_080A9F90(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
|
||||
void sub_080A9FD0(Entity* this) {
|
||||
void MandiblesProjectile_Action2(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x40) != 0) {
|
||||
this->frames.all &= 0xbf;
|
||||
@@ -124,9 +115,9 @@ void sub_080A9FD0(Entity* this) {
|
||||
}
|
||||
|
||||
#ifdef EU
|
||||
ASM_FUNC("asm/non_matching/eu/sub_080AA044.inc", void sub_080AA044(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/eu/MandiblesProjectile_Action3.inc", void MandiblesProjectile_Action3(Entity* this))
|
||||
#else
|
||||
void sub_080AA044(Entity* this) {
|
||||
void MandiblesProjectile_Action3(Entity* this) {
|
||||
u32 uVar1;
|
||||
s8* tmp;
|
||||
Entity* entity;
|
||||
@@ -168,7 +159,7 @@ void sub_080AA044(Entity* this) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080AA110(Entity* this) {
|
||||
void MandiblesProjectile_Action4(Entity* this) {
|
||||
s32 iVar1;
|
||||
u32 uVar2;
|
||||
Entity* entity;
|
||||
@@ -254,13 +245,13 @@ void sub_080AA270(Entity* this) {
|
||||
animationState = parent->animationState;
|
||||
if (this->animationState == 0xff) {
|
||||
this->animationState = animationState;
|
||||
this->hitbox = gUnk_08129CF4[animationState];
|
||||
this->hitbox = (Hitbox*)gUnk_08129CF4[animationState];
|
||||
sub_080AA3E0(this, 0);
|
||||
} else {
|
||||
animationState = (gUnk_08129CAC[Random() & 7] + animationState) & 7;
|
||||
if (animationState != this->animationState) {
|
||||
this->animationState = animationState;
|
||||
this->hitbox = gUnk_08129CF4[animationState];
|
||||
this->hitbox = (Hitbox*)gUnk_08129CF4[animationState];
|
||||
sub_080AA3E0(this, 0);
|
||||
}
|
||||
}
|
||||
@@ -286,7 +277,7 @@ bool32 sub_080AA2E0(Entity* this) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/projectile13/sub_080AA320.inc", void sub_080AA320(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/mandiblesProjectile/sub_080AA320.inc", void sub_080AA320(Entity* this)) {
|
||||
u32 uVar2;
|
||||
Entity* parent;
|
||||
|
||||
@@ -308,7 +299,7 @@ NONMATCH("asm/non_matching/projectile13/sub_080AA320.inc", void sub_080AA320(Ent
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/projectile13/sub_080AA374.inc", bool32 sub_080AA374(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/mandiblesProjectile/sub_080AA374.inc", bool32 sub_080AA374(Entity* this)) {
|
||||
u32 uVar1;
|
||||
u32 animationState;
|
||||
Entity* entity;
|
||||
@@ -340,3 +331,28 @@ void sub_080AA3E0(Entity* this, u32 param) {
|
||||
}
|
||||
InitAnimationForceUpdate(this, tmp);
|
||||
}
|
||||
|
||||
void (*const MandiblesProjectile_Functions[])(Entity*) = {
|
||||
MandiblesProjectile_OnTick, sub_080A9EBC, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const MandiblesProjectile_Actions[])(Entity*) = {
|
||||
MandiblesProjectile_Init, MandiblesProjectile_Action1, MandiblesProjectile_Action2,
|
||||
MandiblesProjectile_Action3, MandiblesProjectile_Action4,
|
||||
};
|
||||
const u8 gUnk_08129CA4[] = { 24, 36, 52, 32, 60, 28, 44, 40 };
|
||||
const u8 gUnk_08129CAC[] = {
|
||||
1, 0, 7, 1, 0, 7, 0, 0,
|
||||
};
|
||||
const Hitbox gUnk_08129CB4 = { 0, -4, { 5, 5, 3, 7 }, 6, 8 };
|
||||
const Hitbox gUnk_08129CBC = { 3, -3, { 5, 3, 3, 5 }, 6, 6 };
|
||||
const Hitbox gUnk_08129CC4 = { 4, 0, { 7, 3, 5, 5 }, 8, 6 };
|
||||
const Hitbox gUnk_08129CCC = { 3, 3, { 5, 3, 3, 5 }, 6, 6 };
|
||||
const Hitbox gUnk_08129CD4 = { 0, 4, { 5, 5, 3, 7 }, 6, 8 };
|
||||
const Hitbox gUnk_08129CDC = { -3, 3, { 5, 3, 3, 5 }, 6, 6 };
|
||||
const Hitbox gUnk_08129CE4 = { -4, 0, { 7, 3, 5, 5 }, 8, 6 };
|
||||
const Hitbox gUnk_08129CEC = { -3, -3, { 5, 3, 3, 5 }, 6, 6 };
|
||||
const Hitbox* const gUnk_08129CF4[] = {
|
||||
&gUnk_08129CB4, &gUnk_08129CBC, &gUnk_08129CC4, &gUnk_08129CCC,
|
||||
&gUnk_08129CD4, &gUnk_08129CDC, &gUnk_08129CE4, &gUnk_08129CEC,
|
||||
};
|
||||
const s8 gUnk_08129D14[] = { 0, -16, 6, -10, 0, 4, -6, -10 };
|
||||
@@ -2,13 +2,13 @@
|
||||
#include "audio.h"
|
||||
#include "coord.h"
|
||||
|
||||
extern void (*const gUnk_08129A64[])(Entity*);
|
||||
extern void (*const MazaalEnergyBeam_Actions[])(Entity*);
|
||||
|
||||
void ProjectileE(Entity* this) {
|
||||
gUnk_08129A64[this->action](this);
|
||||
void MazaalEnergyBeam(Entity* this) {
|
||||
MazaalEnergyBeam_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9518(Entity* this) {
|
||||
void MazaalEnergyBeam_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 10;
|
||||
this->height.HALF.HI -= 2;
|
||||
@@ -17,7 +17,7 @@ void sub_080A9518(Entity* this) {
|
||||
SoundReq(SFX_149);
|
||||
}
|
||||
|
||||
void sub_080A9540(Entity* this) {
|
||||
void MazaalEnergyBeam_Action1(Entity* this) {
|
||||
const s16* tmp;
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
@@ -38,9 +38,15 @@ void sub_080A9540(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A95BC(Entity* this) {
|
||||
void MazaalEnergyBeam_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void (*const MazaalEnergyBeam_Actions[])(Entity*) = {
|
||||
MazaalEnergyBeam_Init,
|
||||
MazaalEnergyBeam_Action1,
|
||||
MazaalEnergyBeam_Action2,
|
||||
};
|
||||
@@ -1,27 +1,25 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
|
||||
extern void (*const gUnk_08129650[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129664[])(Entity*);
|
||||
|
||||
extern bool32 AllocMutableHitbox(Entity*);
|
||||
|
||||
typedef struct {
|
||||
u8 offsetX;
|
||||
u8 offsetY;
|
||||
s8 offsetX;
|
||||
s8 offsetY;
|
||||
u8 width;
|
||||
u8 height;
|
||||
} Test;
|
||||
} HitboxChange;
|
||||
|
||||
extern Test gUnk_0812966C[];
|
||||
extern void (*const MoblinSpear_Functions[])(Entity*);
|
||||
extern void (*const MoblinSpear_Actions[])(Entity*);
|
||||
|
||||
void Projectile3(Entity* this) {
|
||||
gUnk_08129650[GetNextFunction(this)](this);
|
||||
extern const HitboxChange gUnk_0812966C[];
|
||||
|
||||
void MoblinSpear(Entity* this) {
|
||||
MoblinSpear_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A8314(Entity* this) {
|
||||
gUnk_08129664[this->action](this);
|
||||
void MoblinSpear_OnTick(Entity* this) {
|
||||
MoblinSpear_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A832C(Entity* this) {
|
||||
@@ -45,17 +43,17 @@ void sub_080A832C(Entity* this) {
|
||||
this->field_0x42 = 0;
|
||||
}
|
||||
|
||||
void sub_080A83A0(Entity* this) {
|
||||
void MoblinSpear_Init(Entity* this) {
|
||||
if (AllocMutableHitbox(this) != 0) {
|
||||
this->action = 1;
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/projectile3/sub_080A83B4.inc", void sub_080A83B4(Entity* this)) {
|
||||
NONMATCH("asm/non_matching/moblinSpear/MoblinSpear_Action1.inc", void MoblinSpear_Action1(Entity* this)) {
|
||||
u8 frames;
|
||||
Entity* parent;
|
||||
u32 tmp;
|
||||
Test* a;
|
||||
const HitboxChange* a;
|
||||
|
||||
parent = this->parent;
|
||||
if (parent == NULL) {
|
||||
@@ -67,7 +65,7 @@ NONMATCH("asm/non_matching/projectile3/sub_080A83B4.inc", void sub_080A83B4(Enti
|
||||
frames = parent->frames.all * 4;
|
||||
a = &gUnk_0812966C[frames / 4];
|
||||
this->hitbox->offset_x = a->offsetX;
|
||||
// TODO offset used to increate a pointer is already increated here?
|
||||
// TODO offset used to increase a pointer is already increated here?
|
||||
if (parent->frameSpriteSettings == 0x40) {
|
||||
this->hitbox->offset_x = -this->hitbox->offset_x;
|
||||
}
|
||||
@@ -85,3 +83,20 @@ NONMATCH("asm/non_matching/projectile3/sub_080A83B4.inc", void sub_080A83B4(Enti
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void (*const MoblinSpear_Functions[])(Entity*) = {
|
||||
MoblinSpear_OnTick, sub_080A832C, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const MoblinSpear_Actions[])(Entity*) = {
|
||||
MoblinSpear_Init,
|
||||
MoblinSpear_Action1,
|
||||
};
|
||||
|
||||
const HitboxChange gUnk_0812966C[] = {
|
||||
{ 6, 11, 2, 4 }, { -12, 2, 3, 3 }, { -13, -15, 1, 2 }, { 5, 12, 1, 3 }, { 7, 10, 1, 2 }, { 8, 9, 1, 3 },
|
||||
{ 7, 10, 1, 2 }, { -22, 1, 4, 2 }, { -12, 1, 3, 2 }, { -6, 2, 4, 2 }, { -12, 1, 3, 2 }, { -1, -19, 1, 1 },
|
||||
{ -4, -19, 1, 1 }, { -4, -20, 1, 1 }, { -4, -19, 1, 1 }, { 6, 9, 1, 2 }, { 6, 10, 1, 2 }, { 6, 9, 1, 2 },
|
||||
{ 6, 10, 1, 2 }, { -29, -11, 3, 2 }, { -29, -9, 3, 2 }, { -29, -11, 3, 2 }, { -29, -9, 3, 2 }, { -5, -25, 1, 2 },
|
||||
{ -5, -24, 1, 2 }, { -5, -25, 1, 2 }, { -5, -24, 1, 2 }, { 7, 12, 1, 2 }, { 7, 11, 1, 2 }, { -12, 3, 3, 1 },
|
||||
{ -12, 2, 3, 1 }, { -13, -16, 1, 2 }, { -13, -15, 1, 2 },
|
||||
};
|
||||
@@ -4,25 +4,23 @@
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_08129ABC[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129AD0[])(Entity*);
|
||||
|
||||
void sub_080A99F0(Entity*);
|
||||
void OctorokBossProjectile_Action2(Entity*);
|
||||
extern void sub_080AE58C(Entity*, u32, u32);
|
||||
extern u32 sub_0806FC80(Entity*, Entity*, s32);
|
||||
|
||||
extern u8 gUnk_08129ADC[];
|
||||
extern void (*const OctorokBossProjectile_Functions[])(Entity*);
|
||||
extern void (*const OctorokBossProjectile_Actions[])(Entity*);
|
||||
extern const u8 gUnk_08129ADC[];
|
||||
|
||||
void ProjectileF(Entity* this) {
|
||||
gUnk_08129ABC[GetNextFunction(this)](this);
|
||||
void OctorokBossProjectile(Entity* this) {
|
||||
OctorokBossProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A95F8(Entity* this) {
|
||||
gUnk_08129AD0[this->action](this);
|
||||
void OctorokBossProjectile_OnTick(Entity* this) {
|
||||
OctorokBossProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9610(Entity* this) {
|
||||
void OctorokBossProjectile_Init(Entity* this) {
|
||||
u32 uVar1;
|
||||
u32 uVar2;
|
||||
|
||||
@@ -74,7 +72,7 @@ void sub_080A9610(Entity* this) {
|
||||
SoundReq(SFX_1B5);
|
||||
}
|
||||
|
||||
void sub_080A976C(Entity* this) {
|
||||
void OctorokBossProjectile_Action1(Entity* this) {
|
||||
u32 index;
|
||||
|
||||
switch (this->type) {
|
||||
@@ -84,7 +82,7 @@ void sub_080A976C(Entity* this) {
|
||||
}
|
||||
if ((this->type2 == 0) && ((this->bitfield & 0x80) != 0)) {
|
||||
if ((this->bitfield & 0x7f) == 0) {
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
this->direction = this->field_0x3e << 3;
|
||||
this->speed = 0x400;
|
||||
@@ -105,7 +103,7 @@ void sub_080A976C(Entity* this) {
|
||||
this->parent->field_0x3e = this->direction >> 3;
|
||||
}
|
||||
SoundReq(SFX_BOSS_HIT);
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
}
|
||||
UpdateAnimationSingleFrame(this);
|
||||
@@ -133,18 +131,18 @@ void sub_080A976C(Entity* this) {
|
||||
return;
|
||||
}
|
||||
for (index = 0; index < 3; ++index) {
|
||||
this->attachedEntity = sub_0804A98C(this, 0xf, 1);
|
||||
this->attachedEntity = CreateProjectileWithParent(this, 0xf, 1);
|
||||
if (this->attachedEntity != NULL) {
|
||||
this->attachedEntity->parent = this->parent;
|
||||
this->attachedEntity->direction = this->direction + gUnk_08129ADC[index];
|
||||
CopyPosition(this, this->attachedEntity);
|
||||
}
|
||||
}
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
break;
|
||||
case 1:
|
||||
if (this->parent->action == 2) {
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
GetNextFrame(this);
|
||||
if (sub_08003FC4(this, 0x1800) != 0) {
|
||||
@@ -152,7 +150,7 @@ void sub_080A976C(Entity* this) {
|
||||
if (this->collisions == 0) {
|
||||
sub_0806F62C(this, (s32)this->speed, (u32)this->direction);
|
||||
} else {
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
}
|
||||
if (*(u32*)&this->field_0x78 < 0x1e) {
|
||||
@@ -163,12 +161,12 @@ void sub_080A976C(Entity* this) {
|
||||
}
|
||||
}
|
||||
if (--*(u32*)&this->field_0x78 == -1) {
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
}
|
||||
if ((this->bitfield & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
sub_080A99F0(this);
|
||||
OctorokBossProjectile_Action2(this);
|
||||
break;
|
||||
case 2:
|
||||
GetNextFrame(this);
|
||||
@@ -191,7 +189,22 @@ void sub_080A976C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A99F0(Entity* this) {
|
||||
void OctorokBossProjectile_Action2(Entity* this) {
|
||||
CreateFx(this, 4, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void (*const OctorokBossProjectile_Functions[])(Entity*) = {
|
||||
OctorokBossProjectile_OnTick, OctorokBossProjectile_OnTick, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const OctorokBossProjectile_Actions[])(Entity*) = {
|
||||
OctorokBossProjectile_Init,
|
||||
OctorokBossProjectile_Action1,
|
||||
OctorokBossProjectile_Action2,
|
||||
};
|
||||
const u8 gUnk_08129ADC[] = {
|
||||
0,
|
||||
224,
|
||||
32,
|
||||
0,
|
||||
};
|
||||
@@ -1,73 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "coord.h"
|
||||
|
||||
void sub_080A7F80(Entity*);
|
||||
void sub_080A7F9C(Entity*);
|
||||
|
||||
extern u8 gUnk_081293B8[];
|
||||
|
||||
extern void (*const gUnk_081293CC[])(Entity*);
|
||||
|
||||
extern Hitbox** gUnk_081293E0[];
|
||||
|
||||
extern Hitbox* gUnk_081293F0[];
|
||||
|
||||
extern Hitbox* gUnk_08129400[];
|
||||
extern Hitbox* gUnk_08129410[];
|
||||
|
||||
extern Hitbox* gUnk_08129420[];
|
||||
|
||||
void Projectile0(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
sub_080A7F80(this);
|
||||
if (this->type == 3) {
|
||||
InitAnimationForceUpdate(this, this->parent->animationState + 0x18);
|
||||
}
|
||||
}
|
||||
if ((this->parent == NULL) || (this->parent->currentHealth == 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
this->iframes = -0x2d;
|
||||
}
|
||||
this->bitfield = 0;
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
sub_080A7F9C(this);
|
||||
if (this->type == 3) {
|
||||
this->y.HALF.HI += 1;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A7F80(Entity* this) {
|
||||
this->damageType = gUnk_081293B8[this->parent->type + this->type * 4];
|
||||
}
|
||||
|
||||
void sub_080A7F9C(Entity* this) {
|
||||
gUnk_081293CC[this->type](this);
|
||||
}
|
||||
|
||||
void sub_080A7FB4(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = gUnk_081293E0[parent->animationState][(parent->frames.all & 0xf) - 1];
|
||||
}
|
||||
|
||||
void sub_080A7FD8(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = gUnk_081293F0[parent->animationState];
|
||||
}
|
||||
|
||||
void sub_080A7FEC(Entity* this) {
|
||||
if ((this->parent->frames.all & 0x10) != 0) {
|
||||
this->hitbox = gUnk_08129410[this->parent->animationState];
|
||||
} else {
|
||||
this->hitbox = gUnk_08129400[this->parent->animationState];
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A801C(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
this->hitbox = gUnk_08129420[parent->animationState];
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
|
||||
extern void (*const gUnk_08129B58[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129B70[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129B78[])(Entity*);
|
||||
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
extern void sub_08079D84(void);
|
||||
|
||||
void Projectile11(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_08129B58[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A9CD4(Entity* this) {
|
||||
gUnk_08129B70[this->action](this);
|
||||
}
|
||||
|
||||
void nullsub_539(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080A9CF0(Entity* this) {
|
||||
if (sub_0806F520() == 0) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_08129B78[this->subAction](this);
|
||||
}
|
||||
|
||||
void sub_080A9D20(Entity* this) {
|
||||
this->subAction = 2;
|
||||
}
|
||||
|
||||
void nullsub_540(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080A9D2C(Entity* this) {
|
||||
if (sub_0806F3E4(this) != 0) {
|
||||
if (this->damageType == 0xa6) {
|
||||
ModHealth(-2);
|
||||
sub_0800449C(&gPlayerEntity, 0x7a);
|
||||
sub_08079D84();
|
||||
}
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9D6C(Entity* this) {
|
||||
this->action = 1;
|
||||
this->animationState = this->parent->animationState;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
void sub_080A9D80(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, -0x10000);
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
|
||||
extern void (*const gUnk_08129BEC[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129C00[])(Entity*);
|
||||
|
||||
void sub_080A9DC0(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void Projectile12(Entity* this) {
|
||||
gUnk_08129BEC[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A9DC0(Entity* this) {
|
||||
gUnk_08129C00[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9DD8(Entity* this) {
|
||||
if ((this->currentHealth == 0) || (this->bitfield == 0x80)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_080A9DC0(this);
|
||||
}
|
||||
|
||||
void sub_080A9DFC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xb4;
|
||||
this->currentHealth = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void sub_080A9E14(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if ((this->collisions != 0) || (--this->actionDelay == 0)) {
|
||||
CreateFx(this, 0x4f, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A3C0[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A3D4[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void Projectile16(Entity* this) {
|
||||
gUnk_0812A3C0[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AAB04(Entity* this) {
|
||||
gUnk_0812A3D4[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AAB1C(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void sub_080AAB24(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x1e;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void sub_080AAB38(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay -= 1;
|
||||
} else {
|
||||
if (sub_080AF090(this) == 0) {
|
||||
sub_0806F69C(this);
|
||||
} else {
|
||||
this->action = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AAB64(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A58C[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A5A0[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
bool32 sub_080AB5F4(Entity*);
|
||||
|
||||
bool32 sub_080AB634(Entity*);
|
||||
|
||||
extern void sub_080043A8(Entity*);
|
||||
extern void CreateItemOnGround(Entity*);
|
||||
extern void CreateChestSpawner(Entity*);
|
||||
|
||||
void Projectile1B(Entity* this) {
|
||||
gUnk_0812A58C[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AB52C(Entity* this) {
|
||||
gUnk_0812A5A0[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AB544(Entity* this) {
|
||||
u32 tmp;
|
||||
|
||||
if (this->iframes < -4) {
|
||||
this->action = 2;
|
||||
this->direction = this->field_0x3e;
|
||||
tmp = (this->type ^ 2) << 3;
|
||||
if (this->direction - tmp + 1 < 3) {
|
||||
this->direction = tmp;
|
||||
}
|
||||
this->speed = 0x280;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB580(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = this->type << 3;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
void sub_080AB59C(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) == 0) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_080AB5F4(this);
|
||||
}
|
||||
|
||||
void sub_080AB5C4(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if ((sub_080AB634(this) == 0) && (this->collisions != 0)) {
|
||||
CreateFx(this, 2, 0);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_080AB5F4(Entity* this) {
|
||||
u32 uVar1;
|
||||
|
||||
switch (sub_080043E8(this)) {
|
||||
case 1:
|
||||
CreateItemOnGround(this);
|
||||
return TRUE;
|
||||
case 2:
|
||||
sub_080043A8(this);
|
||||
return TRUE;
|
||||
case 3:
|
||||
CreateChestSpawner(this);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1B/sub_080AB634.inc", bool32 sub_080AB634(Entity* this))
|
||||
@@ -1,11 +0,0 @@
|
||||
#include "entity.h"
|
||||
|
||||
extern void (*const gUnk_0812A6CC[])(Entity*);
|
||||
|
||||
void Projectile1E(Entity* this) {
|
||||
gUnk_0812A6CC[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1E/sub_080ABA74.inc", void sub_080ABA74(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1E/sub_080ABAE0.inc", void sub_080ABAE0(Entity* this))
|
||||
@@ -1,66 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812AA5C[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812AA74[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void sub_080ACB90(Entity*);
|
||||
|
||||
void Projectile24(Entity* this) {
|
||||
gUnk_0812AA5C[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080ACA50(Entity* this) {
|
||||
gUnk_0812AA74[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile24/sub_080ACA68.inc", void sub_080ACA68(Entity* this))
|
||||
|
||||
void sub_080ACAC8(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = 0x10;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
this->attachedEntity = NULL;
|
||||
InitializeAnimation(this, 7);
|
||||
SoundReq(SFX_199);
|
||||
}
|
||||
|
||||
void sub_080ACAF0(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
GetNextFrame(this);
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080ACB10(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
GetNextFrame(this);
|
||||
sub_080ACB90(this);
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile24/sub_080ACB40.inc", void sub_080ACB40(Entity* this))
|
||||
|
||||
void sub_080ACB90(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
if ((this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI <= parent->y.HALF.HI)) {
|
||||
parent->field_0xf = 1;
|
||||
CreateFx(this, 0x1f, 0x40);
|
||||
EnqueueSFX(SFX_ITEM_GLOVES_KNOCKBACK);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,22 @@
|
||||
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "player.h"
|
||||
#include "room.h"
|
||||
#include "coord.h"
|
||||
|
||||
extern void (*const gUnk_08129718[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812972C[])(Entity*);
|
||||
|
||||
extern u32 sub_080002E0(u32, u32);
|
||||
|
||||
extern Hitbox gUnk_08129734;
|
||||
extern void (*const Projectile5_Functions[])(Entity*);
|
||||
extern void (*const Projectile5_Actions[])(Entity*);
|
||||
|
||||
extern const Hitbox3D gUnk_08129734;
|
||||
|
||||
void Projectile5(Entity* this) {
|
||||
gUnk_08129718[GetNextFunction(this)](this);
|
||||
Projectile5_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A86D8(Entity* this) {
|
||||
gUnk_0812972C[this->action](this);
|
||||
void Projectile5_OnTick(Entity* this) {
|
||||
Projectile5_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A86F0(Entity* this) {
|
||||
@@ -43,16 +41,14 @@ void sub_080A86F0(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8770(Entity* this) {
|
||||
void Projectile5_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x3c |= 0x10;
|
||||
this->hitbox = &gUnk_08129734;
|
||||
this->hitbox = (Hitbox*)&gUnk_08129734;
|
||||
}
|
||||
|
||||
void sub_080A878C(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
void Projectile5_Action1(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if (parent == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -65,3 +61,12 @@ void sub_080A878C(Entity* this) {
|
||||
CopyPosition(parent, this);
|
||||
this->height.HALF.HI += 2;
|
||||
}
|
||||
|
||||
void (*const Projectile5_Functions[])(Entity*) = {
|
||||
Projectile5_OnTick, sub_080A86F0, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const Projectile5_Actions[])(Entity*) = {
|
||||
Projectile5_Init,
|
||||
Projectile5_Action1,
|
||||
};
|
||||
const Hitbox3D gUnk_08129734 = { 0, 0, { 9, 6, 6, 9 }, 10, 10, 12, { 0, 0, 0 } };
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#include "entity.h"
|
||||
#include "player.h"
|
||||
#include "coord.h"
|
||||
|
||||
extern Hitbox* gUnk_08129998[];
|
||||
extern void sub_0803C0AC(Entity*);
|
||||
|
||||
void ProjectileB(Entity* this) {
|
||||
Entity* parent;
|
||||
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
}
|
||||
parent = this->parent;
|
||||
if (((parent == NULL) || (parent->currentHealth == 0)) || (parent->next == NULL)) {
|
||||
if (((this->bitfield & 0x80) != 0) && (this->field_0x4c == &gPlayerEntity)) {
|
||||
sub_0803C0AC(this);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
this->hitbox = gUnk_08129998[parent->animationState];
|
||||
CopyPosition(parent, this);
|
||||
if ((parent->iframes != 0) && (this->iframes == 0)) {
|
||||
this->iframes = 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,30 +5,26 @@
|
||||
#include "flags.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern void (*const gUnk_08129FB8[])(Entity*);
|
||||
extern u32 sub_080002C8(u16, u8);
|
||||
extern Entity* LoadRoomEntity(EntityData*);
|
||||
|
||||
extern void (*const RemovableDust_Functions[])(Entity*);
|
||||
extern const u16 gUnk_08129FD0[];
|
||||
extern const u16 gUnk_08129FE4[];
|
||||
extern const s8 gUnk_08129FF8[];
|
||||
extern const u8 gUnk_0812A004[];
|
||||
|
||||
void sub_080AA494(Entity*);
|
||||
void sub_080AA534(Entity*);
|
||||
|
||||
void sub_080AA464(Entity*);
|
||||
|
||||
void sub_080AA544(Entity*);
|
||||
|
||||
extern u16 gUnk_08129FD0[];
|
||||
void sub_080AA654(Entity*, u32);
|
||||
|
||||
extern s8 gUnk_08129FF8[];
|
||||
extern u16 gUnk_08129FE4[];
|
||||
extern u32 sub_080002C8(u16, u8);
|
||||
|
||||
extern u32 gUnk_0812A004;
|
||||
extern Entity* LoadRoomEntity(EntityData*);
|
||||
|
||||
void Projectile14(Entity* this) {
|
||||
gUnk_08129FB8[GetNextFunction(this)](this);
|
||||
void RemovableDust(Entity* this) {
|
||||
RemovableDust_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AA41C(Entity* this) {
|
||||
void RemovableDust_OnTick(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->frameIndex = this->type;
|
||||
@@ -63,7 +59,7 @@ void sub_080AA464(Entity* this) {
|
||||
|
||||
void sub_080AA494(Entity* this) {
|
||||
u32 tileType;
|
||||
u16* iterator;
|
||||
const u16* iterator;
|
||||
u32 index;
|
||||
|
||||
index = 0;
|
||||
@@ -91,14 +87,14 @@ void sub_080AA534(Entity* this) {
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/projectile14/sub_080AA544.inc", void sub_080AA544(Entity* this)) {
|
||||
void sub_080AA544(Entity* this) {
|
||||
u8* pbVar1;
|
||||
s32 iVar2;
|
||||
u32 uVar3;
|
||||
s32 iVar4;
|
||||
u16* puVar5;
|
||||
const u16* puVar5;
|
||||
u32 param;
|
||||
s8* tmp;
|
||||
const s8* tmp;
|
||||
|
||||
if (this->type2 < 9) {
|
||||
tmp = gUnk_08129FF8;
|
||||
@@ -124,18 +120,13 @@ NONMATCH("asm/non_matching/projectile14/sub_080AA544.inc", void sub_080AA544(Ent
|
||||
sub_080AA654(this, param);
|
||||
SetFlag((u16)this->speed);
|
||||
} else {
|
||||
sub_0807B7D8(gUnk_08129FE4[this->type2],
|
||||
param -
|
||||
// TODO this array access is wrong
|
||||
*((s8*)gUnk_08129FE4 + this->type2),
|
||||
this->collisionLayer);
|
||||
sub_0807B7D8(gUnk_08129FE4[this->type2], param - tmp[this->type2], this->collisionLayer);
|
||||
}
|
||||
} else {
|
||||
sub_0807BA8C(TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
SetFlag((u16)this->speed);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080AA654(Entity* this, u32 param) {
|
||||
EntityData* entityData;
|
||||
@@ -148,3 +139,13 @@ void sub_080AA654(Entity* this, u32 param) {
|
||||
|
||||
LoadRoomEntity(entityData);
|
||||
}
|
||||
|
||||
void (*const RemovableDust_Functions[])(Entity*) = {
|
||||
RemovableDust_OnTick, sub_080AA450, DeleteEntity, DeleteEntity, DeleteEntity, sub_080AA464,
|
||||
};
|
||||
const u16 gUnk_08129FD0[] = { 387, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 0 };
|
||||
const u16 gUnk_08129FE4[] = { 388, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 0 };
|
||||
const s8 gUnk_08129FF8[] = { 65, 64, 63, 1, 0, -1, -63, -64, -65, 0, 0, 0 };
|
||||
const u8 gUnk_0812A004[] = {
|
||||
9, 0, 3, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
@@ -2,22 +2,21 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_081295D0[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_081295E4[])(Entity*);
|
||||
|
||||
void sub_080A8178(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
|
||||
void Projectile1(Entity* this) {
|
||||
gUnk_081295D0[GetNextFunction(this)](this);
|
||||
extern void (*const RockProjectile_Functions[])(Entity*);
|
||||
extern void (*const RockProjectile_Actions[])(Entity*);
|
||||
|
||||
void sub_080A8178(Entity*);
|
||||
|
||||
void RockProjectile(Entity* this) {
|
||||
RockProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A804C(Entity* this) {
|
||||
gUnk_081295E4[this->action](this);
|
||||
void RockProjectile_OnTick(Entity* this) {
|
||||
RockProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8064(Entity* this) {
|
||||
@@ -29,14 +28,14 @@ void sub_080A8064(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8088(Entity* this) {
|
||||
void RockProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x30;
|
||||
this->field_0x20 = 0xa000;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void sub_080A80A0(Entity* this) {
|
||||
void RockProjectile_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) != 0) {
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -54,7 +53,7 @@ void sub_080A80A0(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A80F4(Entity* this) {
|
||||
void RockProjectile_Action2(Entity* this) {
|
||||
sub_0806F69C(this);
|
||||
GetNextFrame(this);
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
@@ -62,7 +61,7 @@ void sub_080A80F4(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8118(Entity* this) {
|
||||
void RockProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
switch (sub_080044EC(this, 0x2800)) {
|
||||
@@ -89,3 +88,13 @@ void sub_080A8178(Entity* this) {
|
||||
this->speed = 0x40;
|
||||
this->field_0x20 = 0x14000;
|
||||
}
|
||||
|
||||
void (*const RockProjectile_Functions[])(Entity*) = {
|
||||
RockProjectile_OnTick, sub_080A8064, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const RockProjectile_Actions[])(Entity*) = {
|
||||
RockProjectile_Init,
|
||||
RockProjectile_Action1,
|
||||
RockProjectile_Action2,
|
||||
RockProjectile_Action3,
|
||||
};
|
||||
@@ -5,35 +5,30 @@
|
||||
#include "object.h"
|
||||
#include "flags.h"
|
||||
|
||||
extern void (*const gUnk_0812A014[])(Entity*);
|
||||
extern void sub_0806FBB4(Entity*);
|
||||
extern u32 sub_080002D4(s32, s32, u32);
|
||||
|
||||
extern void (*const gUnk_0812A02C[])(Entity*);
|
||||
|
||||
extern u8 gUnk_0812A03C[];
|
||||
extern void (*const SpiderWeb_Functions[])(Entity*);
|
||||
extern void (*const SpiderWeb_Actions[])(Entity*);
|
||||
extern const u8 gUnk_0812A03C[];
|
||||
extern const Hitbox* const gUnk_0812A04C[];
|
||||
extern void (*const SpiderWeb_SubActions[])(Entity*);
|
||||
extern const s8 gUnk_0812A064[];
|
||||
extern const s8 gUnk_0812A06C[];
|
||||
extern const u8 gUnk_0812A074[];
|
||||
extern const u16 gUnk_0812A084[];
|
||||
|
||||
void sub_080AA6C0(Entity*);
|
||||
void sub_080AAAA8(Entity*);
|
||||
|
||||
extern Hitbox* gUnk_0812A04C[];
|
||||
void sub_080AAA68(Entity*);
|
||||
|
||||
void sub_080AA9E0(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A05C[])(Entity*);
|
||||
extern void sub_0806FBB4(Entity*);
|
||||
|
||||
extern u16 gUnk_0812A084[];
|
||||
|
||||
extern u32 sub_080002D4(s32, s32, u32);
|
||||
extern s8 gUnk_0812A064[];
|
||||
extern s8 gUnk_0812A06C[];
|
||||
|
||||
void Projectile15(Entity* this) {
|
||||
gUnk_0812A014[GetNextFunction(this)](this);
|
||||
void SpiderWeb(Entity* this) {
|
||||
SpiderWeb_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AA6A8(Entity* this) {
|
||||
gUnk_0812A02C[this->action](this);
|
||||
void SpiderWeb_OnTick(Entity* this) {
|
||||
SpiderWeb_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AA6C0(Entity* this) {
|
||||
@@ -101,32 +96,32 @@ void sub_080AA78C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AA834(Entity* this) {
|
||||
void SpiderWeb_Init(Entity* this) {
|
||||
if (CheckFlags(this->field_0x86.HWORD) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
this->action = 1;
|
||||
this->field_0x1c = 1;
|
||||
this->field_0x16 = 1;
|
||||
this->hitbox = gUnk_0812A04C[this->type];
|
||||
this->hitbox = (Hitbox*)gUnk_0812A04C[this->type];
|
||||
this->cutsceneBeh.HALF.LO = 0;
|
||||
InitAnimationForceUpdate(this, this->type);
|
||||
sub_080AAA68(this);
|
||||
}
|
||||
|
||||
void sub_080AA878(Entity* this) {
|
||||
void SpiderWeb_Action1(Entity* this) {
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
sub_080AA9E0(this);
|
||||
}
|
||||
|
||||
void sub_080AA898(Entity* this) {
|
||||
void SpiderWeb_Action2(Entity* this) {
|
||||
sub_0806FBB4(this);
|
||||
gUnk_0812A05C[this->subAction - 5](this);
|
||||
SpiderWeb_SubActions[this->subAction - 5](this);
|
||||
}
|
||||
|
||||
void sub_080AA8B8(Entity* this) {
|
||||
void SpiderWeb_SubAction0(Entity* this) {
|
||||
u32 tmp;
|
||||
u16 x;
|
||||
u16 y;
|
||||
@@ -160,20 +155,20 @@ void sub_080AA8B8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AA9AC(Entity* this) {
|
||||
void SpiderWeb_SubAction1(Entity* this) {
|
||||
this->action = 1;
|
||||
this->cutsceneBeh.HALF.LO = 0;
|
||||
InitAnimationForceUpdate(this, this->type + 0xc);
|
||||
}
|
||||
|
||||
void sub_080AA9C4(Entity* this) {
|
||||
void SpiderWeb_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (--this->actionDelay == 0) {
|
||||
sub_080AAAA8(this);
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile15/sub_080AA9E0.inc", void sub_080AA9E0(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/spiderWeb/sub_080AA9E0.inc", void sub_080AA9E0(Entity* this))
|
||||
|
||||
void sub_080AAA68(Entity* this) {
|
||||
SetTile(gUnk_0812A084[this->type], TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
@@ -184,3 +179,34 @@ void sub_080AAAA8(Entity* this) {
|
||||
sub_0807BA8C(TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void (*const SpiderWeb_Functions[])(Entity*) = {
|
||||
SpiderWeb_OnTick, sub_080AA6C0, DeleteEntity, DeleteEntity, DeleteEntity, sub_080AA78C,
|
||||
};
|
||||
void (*const SpiderWeb_Actions[])(Entity*) = {
|
||||
SpiderWeb_Init,
|
||||
SpiderWeb_Action1,
|
||||
SpiderWeb_Action2,
|
||||
SpiderWeb_Action3,
|
||||
};
|
||||
const u8 gUnk_0812A03C[] = {
|
||||
248, 252, 6, 1, 4, 245, 253, 3, 249, 253, 6, 4, 252, 245, 3, 3,
|
||||
};
|
||||
extern const Hitbox gUnk_080FD41C;
|
||||
extern const Hitbox gUnk_080FD424;
|
||||
extern const Hitbox gUnk_080FD42C;
|
||||
extern const Hitbox gUnk_080FD434;
|
||||
const Hitbox* const gUnk_0812A04C[] = {
|
||||
&gUnk_080FD41C,
|
||||
&gUnk_080FD424,
|
||||
&gUnk_080FD42C,
|
||||
&gUnk_080FD434,
|
||||
};
|
||||
void (*const SpiderWeb_SubActions[])(Entity*) = {
|
||||
SpiderWeb_SubAction0,
|
||||
SpiderWeb_SubAction1,
|
||||
};
|
||||
const s8 gUnk_0812A064[] = { 0, 17, -15, 4, 0, -11, 15, 4 };
|
||||
const s8 gUnk_0812A06C[] = { 0, 2, -2, 0, 0, -2, 2, 0 };
|
||||
const u8 gUnk_0812A074[] = { 4, 0, 5, 16, 3, 8, 5, 24, 3, 16, 5, 0, 3, 24, 5, 8 };
|
||||
const u16 gUnk_0812A084[] = { 16419, 16421, 16422, 16420 };
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "entity.h"
|
||||
|
||||
extern void (*const SpikedRollers_Actions[])(Entity*);
|
||||
extern const u8 gUnk_0812A6D4[];
|
||||
|
||||
void SpikedRollers(Entity* this) {
|
||||
SpikedRollers_Actions[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/spikedRollers/sub_080ABA74.inc", void sub_080ABA74(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/spikedRollers/sub_080ABAE0.inc", void sub_080ABAE0(Entity* this))
|
||||
|
||||
void (*const SpikedRollers_Actions[])(Entity*) = {
|
||||
sub_080ABA74,
|
||||
sub_080ABAE0,
|
||||
};
|
||||
const u8 gUnk_0812A6D4[] = {
|
||||
8, 16, 24, 32, 40, 48, 56, 16, 24, 32, 40, 48, 56, 64,
|
||||
};
|
||||
@@ -2,33 +2,30 @@
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_08129AE0[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129AF8[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_08129B08[])(Entity*);
|
||||
void sub_080A9BA8(Entity*);
|
||||
|
||||
void sub_080A9BD0(Entity*);
|
||||
void sub_080A9C34(Entity*);
|
||||
|
||||
void sub_080A9C50(Entity*);
|
||||
extern void (*const StalfosProjectile_Functions[])(Entity*);
|
||||
extern void (*const StalfosProjectile_Actions[])(Entity*);
|
||||
extern void (*const StalfosProjectile_SubActions[])(Entity*);
|
||||
|
||||
typedef struct {
|
||||
s8 unk_0;
|
||||
s8 unk_1;
|
||||
s8 unk_2;
|
||||
} PACKED struct_08129B20;
|
||||
extern struct_08129B20 gUnk_08129B20[];
|
||||
extern const struct_08129B20 gUnk_08129B20[];
|
||||
|
||||
extern u8 gUnk_08129B50[];
|
||||
extern const u8 gUnk_08129B50[];
|
||||
|
||||
void Projectile10(Entity* this) {
|
||||
gUnk_08129AE0[GetNextFunction(this)](this);
|
||||
void sub_080A9BA8(Entity*);
|
||||
void sub_080A9BD0(Entity*);
|
||||
void sub_080A9C34(Entity*);
|
||||
void sub_080A9C50(Entity*);
|
||||
|
||||
void StalfosProjectile(Entity* this) {
|
||||
StalfosProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080A9A1C(Entity* this) {
|
||||
gUnk_08129AF8[this->action](this);
|
||||
void StalfosProjectile_OnTick(Entity* this) {
|
||||
StalfosProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A9A34(Entity* this) {
|
||||
@@ -44,34 +41,34 @@ void sub_080A9A64(Entity* this) {
|
||||
if ((this->subAction < 3) && (sub_0806F520(this) == 0)) {
|
||||
sub_080A9BA8(this);
|
||||
}
|
||||
gUnk_08129B08[this->subAction](this);
|
||||
StalfosProjectile_SubActions[this->subAction](this);
|
||||
}
|
||||
|
||||
void sub_080A9A94(Entity* this) {
|
||||
void StalfosProjectile_SubAction0(Entity* this) {
|
||||
this->subAction = 2;
|
||||
this->height.HALF.HI = 0xfffe;
|
||||
}
|
||||
|
||||
void sub_080A9AA4(Entity* this) {
|
||||
void StalfosProjectile_SubAction1(Entity* this) {
|
||||
sub_0806F4E8(this);
|
||||
}
|
||||
|
||||
void sub_080A9AAC(Entity* this) {
|
||||
void StalfosProjectile_SubAction2(Entity* this) {
|
||||
sub_0806F3E4(this);
|
||||
}
|
||||
|
||||
void sub_080A9AB4(Entity* this) {
|
||||
void StalfosProjectile_SubAction3(Entity* this) {
|
||||
this->flags &= 0x7f;
|
||||
}
|
||||
|
||||
void nullsub_128(Entity* this) {
|
||||
void StalfosProjectile_SubAction4(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080A9AC4(Entity* this) {
|
||||
void StalfosProjectile_SubAction5(Entity* this) {
|
||||
sub_080A9BA8(this);
|
||||
}
|
||||
|
||||
void sub_080A9ACC(Entity* this) {
|
||||
void StalfosProjectile_Init(Entity* this) {
|
||||
switch (this->type2) {
|
||||
case 1:
|
||||
this->action = 2;
|
||||
@@ -95,7 +92,7 @@ void sub_080A9ACC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9B24(Entity* this) {
|
||||
void StalfosProjectile_Action1(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
sub_080A9BA8(this);
|
||||
}
|
||||
@@ -107,7 +104,7 @@ void sub_080A9B24(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9B54(Entity* this) {
|
||||
void StalfosProjectile_Action2(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
sub_080A9BA8(this);
|
||||
}
|
||||
@@ -118,7 +115,7 @@ void sub_080A9B54(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A9B80(Entity* this) {
|
||||
void StalfosProjectile_Action3(Entity* this) {
|
||||
if (this->field_0x20 < 0) {
|
||||
this->spriteSettings.b.flipY = 1;
|
||||
}
|
||||
@@ -140,7 +137,7 @@ void sub_080A9BD0(Entity* this) {
|
||||
Entity* parent;
|
||||
s32 tmp;
|
||||
u32 tmp2;
|
||||
struct_08129B20* entry;
|
||||
const struct_08129B20* entry;
|
||||
|
||||
parent = this->parent;
|
||||
switch (parent->animationState) {
|
||||
@@ -186,3 +183,23 @@ void sub_080A9C50(Entity* this) {
|
||||
sub_0806FA90(parent, this, 0, 1);
|
||||
this->spriteOffsetY += gUnk_08129B50[tmp];
|
||||
}
|
||||
|
||||
void (*const StalfosProjectile_Functions[])(Entity*) = {
|
||||
StalfosProjectile_OnTick, sub_080A9A34, DeleteEntity, DeleteEntity, DeleteEntity, sub_080A9A64,
|
||||
};
|
||||
void (*const StalfosProjectile_Actions[])(Entity*) = {
|
||||
StalfosProjectile_Init,
|
||||
StalfosProjectile_Action1,
|
||||
StalfosProjectile_Action2,
|
||||
StalfosProjectile_Action3,
|
||||
};
|
||||
void (*const StalfosProjectile_SubActions[])(Entity*) = {
|
||||
StalfosProjectile_SubAction0, StalfosProjectile_SubAction1, StalfosProjectile_SubAction2,
|
||||
StalfosProjectile_SubAction3, StalfosProjectile_SubAction4, StalfosProjectile_SubAction5,
|
||||
};
|
||||
const struct_08129B20 gUnk_08129B20[] = {
|
||||
{ 0, -9, -1 }, { 0, 5, -25 }, { 0, 3, -20 }, { 0, 0, -14 }, { 10, 0, -1 }, { -5, 0, -24 },
|
||||
{ -3, 0, -20 }, { 0, 0, -13 }, { 0, 5, -1 }, { 0, -5, -19 }, { 0, -3, -16 }, { 0, 0, -11 },
|
||||
{ -10, 0, -1 }, { 5, 0, -24 }, { 3, 0, -20 }, { 0, 0, -13 },
|
||||
};
|
||||
const u8 gUnk_08129B50[] = { 241, 243, 242, 241, 243, 242, 0, 0 };
|
||||
@@ -0,0 +1,60 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
extern void (*const TorchTrapProjectile_Functions[])(Entity*);
|
||||
extern void (*const TorchTrapProjectile_Actions[])(Entity*);
|
||||
|
||||
void TorchTrapProjectile(Entity* this) {
|
||||
TorchTrapProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void TorchTrapProjectile_OnTick(Entity* this) {
|
||||
TorchTrapProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AAB1C(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void TorchTrapProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x1e;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
|
||||
void TorchTrapProjectile_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay -= 1;
|
||||
} else {
|
||||
if (sub_080AF090(this) == 0) {
|
||||
sub_0806F69C(this);
|
||||
} else {
|
||||
this->action = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TorchTrapProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void (*const TorchTrapProjectile_Functions[])(Entity*) = {
|
||||
TorchTrapProjectile_OnTick, sub_080AAB1C, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const TorchTrapProjectile_Actions[])(Entity*) = {
|
||||
TorchTrapProjectile_Init,
|
||||
TorchTrapProjectile_Action1,
|
||||
TorchTrapProjectile_Action2,
|
||||
};
|
||||
@@ -6,23 +6,21 @@
|
||||
#include "functions.h"
|
||||
#include "random.h"
|
||||
|
||||
extern void (*const gUnk_0812A418[])(Entity*);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
|
||||
extern void (*const gUnk_0812A430[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A440[])(Entity*);
|
||||
extern void (*const V1DarkMagicProjectile_Functions[])(Entity*);
|
||||
extern void (*const V1DarkMagicProjectile_Actions[])(Entity*);
|
||||
extern void (*const V1DarkMagicProjectile_SubActions[])(Entity*);
|
||||
|
||||
void sub_080AAF74(Entity*);
|
||||
void sub_080AB034(Entity*);
|
||||
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
|
||||
void Projectile18(Entity* this) {
|
||||
gUnk_0812A418[GetNextFunction(this)](this);
|
||||
void V1DarkMagicProjectile(Entity* this) {
|
||||
V1DarkMagicProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AAC0C(Entity* this) {
|
||||
gUnk_0812A430[this->action](this);
|
||||
void V1DarkMagicProjectile_OnTick(Entity* this) {
|
||||
V1DarkMagicProjectile_Actions[this->action](this);
|
||||
if ((this->type2 == 0) && (--this->cutsceneBeh.HWORD == 0)) {
|
||||
this->currentHealth = 0;
|
||||
}
|
||||
@@ -56,29 +54,29 @@ void sub_080AAC44(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile18/sub_080AACE0.inc", void sub_080AACE0(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v1DarkMagicProjectile/sub_080AACE0.inc", void sub_080AACE0(Entity* this))
|
||||
|
||||
void sub_080AAD70(Entity* this) {
|
||||
if (sub_0806F520() == 0) {
|
||||
this->currentHealth = 0;
|
||||
}
|
||||
gUnk_0812A440[this->subAction](this);
|
||||
V1DarkMagicProjectile_SubActions[this->subAction](this);
|
||||
}
|
||||
|
||||
void sub_080AAD98(Entity* this) {
|
||||
void V1DarkMagicProjectile_SubAction0(Entity* this) {
|
||||
this->subAction = 2;
|
||||
}
|
||||
|
||||
void nullsub_541(Entity* this) {
|
||||
void V1DarkMagicProjectile_SubAction1(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_080AADA4(Entity* this) {
|
||||
void V1DarkMagicProjectile_SubAction2(Entity* this) {
|
||||
if (sub_0806F3E4(this) != 0) {
|
||||
this->currentHealth = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AADBC(Entity* this) {
|
||||
void V1DarkMagicProjectile_Init(Entity* this) {
|
||||
Entity* entity;
|
||||
|
||||
if (this->type2 == 0) {
|
||||
@@ -101,7 +99,7 @@ void sub_080AADBC(Entity* this) {
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
this->field_0x86.HALF.LO = 0;
|
||||
this->cutsceneBeh.HWORD = 300;
|
||||
entity = sub_080A7EE0(0x18);
|
||||
entity = CreateProjectile(0x18);
|
||||
if (entity != NULL) {
|
||||
entity->type = 1;
|
||||
entity->type2 = this->type2;
|
||||
@@ -115,7 +113,7 @@ void sub_080AADBC(Entity* this) {
|
||||
InitializeAnimation(this, this->type);
|
||||
}
|
||||
|
||||
void sub_080AAE88(Entity* this) {
|
||||
void V1DarkMagicProjectile_Action1(Entity* this) {
|
||||
u8 bVar1;
|
||||
u32 uVar2;
|
||||
|
||||
@@ -142,12 +140,12 @@ void sub_080AAE88(Entity* this) {
|
||||
sub_080AB034(this);
|
||||
}
|
||||
|
||||
void sub_080AAF00(Entity* this) {
|
||||
void V1DarkMagicProjectile_Action2(Entity* this) {
|
||||
sub_080AAF74(this);
|
||||
sub_080AB034(this);
|
||||
}
|
||||
|
||||
void sub_080AAF10(Entity* this) {
|
||||
void V1DarkMagicProjectile_Action3(Entity* this) {
|
||||
CopyPosition(this->parent, this);
|
||||
sub_080AB034(this);
|
||||
this->spriteSettings.b.draw = this->parent->spriteSettings.b.draw;
|
||||
@@ -206,3 +204,18 @@ void sub_080AB034(Entity* this) {
|
||||
}
|
||||
sub_0801D2B4(this, tmp);
|
||||
}
|
||||
|
||||
void (*const V1DarkMagicProjectile_Functions[])(Entity*) = {
|
||||
V1DarkMagicProjectile_OnTick, sub_080AAC44, DeleteEntity, sub_080AACE0, DeleteEntity, sub_080AAD70,
|
||||
};
|
||||
void (*const V1DarkMagicProjectile_Actions[])(Entity*) = {
|
||||
V1DarkMagicProjectile_Init,
|
||||
V1DarkMagicProjectile_Action1,
|
||||
V1DarkMagicProjectile_Action2,
|
||||
V1DarkMagicProjectile_Action3,
|
||||
};
|
||||
void (*const V1DarkMagicProjectile_SubActions[])(Entity*) = {
|
||||
V1DarkMagicProjectile_SubAction0,
|
||||
V1DarkMagicProjectile_SubAction1,
|
||||
V1DarkMagicProjectile_SubAction2,
|
||||
};
|
||||
@@ -1,32 +1,27 @@
|
||||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A5E8[])(Entity*);
|
||||
|
||||
extern Hitbox gUnk_0812A614;
|
||||
extern void (*const V1EyeLaser_Actions[])(Entity*);
|
||||
extern const Hitbox* const gUnk_0812A5F4[];
|
||||
extern const Hitbox gUnk_0812A614;
|
||||
extern const Hitbox gUnk_0812A61C;
|
||||
|
||||
void sub_080AB758(Entity*);
|
||||
|
||||
void sub_080AB888(Entity*);
|
||||
|
||||
extern Hitbox gUnk_0812A614;
|
||||
extern Hitbox gUnk_0812A61C;
|
||||
|
||||
extern Hitbox* gUnk_0812A5F4[];
|
||||
|
||||
void Projectile1C(Entity* this) {
|
||||
void V1EyeLaser(Entity* this) {
|
||||
if (this->parent->spriteSettings.b.draw == 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_0812A5E8[this->action](this);
|
||||
V1EyeLaser_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AB6B8(Entity* this) {
|
||||
void V1EyeLaser_Init(Entity* this) {
|
||||
*(u32*)&this->field_0x74 = this->parent->x.WORD;
|
||||
if (this->type == 0) {
|
||||
this->action = 1;
|
||||
this->flags &= 0x7f;
|
||||
this->hitbox = &gUnk_0812A614;
|
||||
this->hitbox = (Hitbox*)&gUnk_0812A614;
|
||||
InitializeAnimation(this, 0);
|
||||
} else {
|
||||
this->action = 2;
|
||||
@@ -35,7 +30,7 @@ void sub_080AB6B8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB6FC(Entity* this) {
|
||||
void V1EyeLaser_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 2;
|
||||
@@ -44,7 +39,7 @@ void sub_080AB6FC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB728(Entity* this) {
|
||||
void V1EyeLaser_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
this->x.WORD += (this->parent->x.WORD - *(u32*)&this->field_0x74);
|
||||
*(u32*)&this->field_0x74 = this->parent->x.WORD;
|
||||
@@ -54,21 +49,21 @@ void sub_080AB728(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1C/sub_080AB758.inc", void sub_080AB758(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v1EyeLaser/sub_080AB758.inc", void sub_080AB758(Entity* this))
|
||||
|
||||
void sub_080AB844(Entity* this, s32 param_1, s32 param_2) {
|
||||
Entity* entity;
|
||||
|
||||
entity = sub_080A7EE0(0x1c);
|
||||
entity = CreateProjectile(0x1c);
|
||||
if (entity != NULL) {
|
||||
entity->type = 1;
|
||||
entity->actionDelay = param_1;
|
||||
entity->parent = this->parent;
|
||||
PositionRelative(this, entity, 0, param_2 << 0x10);
|
||||
if (param_1 != 1) {
|
||||
entity->hitbox = &gUnk_0812A61C;
|
||||
entity->hitbox = (Hitbox*)&gUnk_0812A61C;
|
||||
} else {
|
||||
entity->hitbox = &gUnk_0812A614;
|
||||
entity->hitbox = (Hitbox*)&gUnk_0812A614;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +78,7 @@ void sub_080AB888(Entity* this) {
|
||||
case 3:
|
||||
index = 1;
|
||||
case 4:
|
||||
this->hitbox = gUnk_0812A5F4[this->field_0xf * 2 + index];
|
||||
this->hitbox = (Hitbox*)gUnk_0812A5F4[this->field_0xf * 2 + index];
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
@@ -96,3 +91,24 @@ void sub_080AB888(Entity* this) {
|
||||
this->field_0xf = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void (*const V1EyeLaser_Actions[])(Entity*) = {
|
||||
V1EyeLaser_Init,
|
||||
V1EyeLaser_Action1,
|
||||
V1EyeLaser_Action2,
|
||||
};
|
||||
|
||||
extern const Hitbox gUnk_0812A624;
|
||||
extern const Hitbox gUnk_0812A62C;
|
||||
extern const Hitbox gUnk_0812A634;
|
||||
|
||||
const Hitbox* const gUnk_0812A5F4[] = {
|
||||
&gUnk_0812A61C, &gUnk_0812A61C, &gUnk_0812A624, &gUnk_0812A61C,
|
||||
&gUnk_0812A62C, &gUnk_0812A624, &gUnk_0812A634, &gUnk_0812A624,
|
||||
};
|
||||
|
||||
const Hitbox gUnk_0812A614 = { 0, 4, { 0, 0, 0, 0 }, 1, 3 };
|
||||
const Hitbox gUnk_0812A61C = { 0, 8, { 0, 0, 0, 0 }, 1, 6 };
|
||||
const Hitbox gUnk_0812A624 = { 0, 24, { 0, 0, 0, 0 }, 1, 6 };
|
||||
const Hitbox gUnk_0812A62C = { 0, 40, { 0, 0, 0, 0 }, 1, 6 };
|
||||
const Hitbox gUnk_0812A634 = { 0, 56, { 0, 0, 0, 0 }, 1, 6 };
|
||||
@@ -5,24 +5,22 @@
|
||||
#include "audio.h"
|
||||
#include "random.h"
|
||||
|
||||
extern void (*const gUnk_0812A4C8[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A4DC[])(Entity*);
|
||||
|
||||
void sub_080AB4A4(Entity*);
|
||||
|
||||
extern void sub_0806F5BC(Entity*, u32, u32);
|
||||
extern u32 sub_080041DC(Entity*, u32, u32);
|
||||
|
||||
extern void (*const V1FireProjectile_Functions[])(Entity*);
|
||||
extern void (*const V1FireProjectile_Actions[])(Entity*);
|
||||
extern const s8 gUnk_0812A4EC[];
|
||||
|
||||
void sub_080AB4A4(Entity*);
|
||||
s8* sub_080AB4F8(Entity*);
|
||||
|
||||
extern s8 gUnk_0812A4EC[];
|
||||
|
||||
void Projectile1A(Entity* this) {
|
||||
gUnk_0812A4C8[GetNextFunction(this)](this);
|
||||
void V1FireProjectile(Entity* this) {
|
||||
V1FireProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080AB2C4(Entity* this) {
|
||||
gUnk_0812A4DC[this->action](this);
|
||||
void V1FireProjectile_OnTick(Entity* this) {
|
||||
V1FireProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080AB2DC(Entity* this) {
|
||||
@@ -36,7 +34,7 @@ void sub_080AB2DC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB318(Entity* this) {
|
||||
void V1FireProjectile_Init(Entity* this) {
|
||||
s32 iVar2;
|
||||
u32 rnd;
|
||||
u32 x;
|
||||
@@ -75,7 +73,7 @@ void sub_080AB318(Entity* this) {
|
||||
this->direction = sub_080045B4(this, x, y);
|
||||
}
|
||||
|
||||
void sub_080AB414(Entity* this) {
|
||||
void V1FireProjectile_Action1(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
sub_0806F69C(this);
|
||||
if (sub_08003FC4(this, 0) == 0) {
|
||||
@@ -90,7 +88,7 @@ void sub_080AB414(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB45C(Entity* this) {
|
||||
void V1FireProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->action = 3;
|
||||
@@ -99,7 +97,7 @@ void sub_080AB45C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AB488(Entity* this) {
|
||||
void V1FireProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteThisEntity();
|
||||
@@ -124,5 +122,24 @@ void sub_080AB4A4(Entity* this) {
|
||||
}
|
||||
|
||||
s8* sub_080AB4F8(Entity* this) {
|
||||
return &gUnk_0812A4EC[this->type << 5 | this->field_0xf << 1];
|
||||
return (s8*)&gUnk_0812A4EC[this->type << 5 | this->field_0xf << 1];
|
||||
}
|
||||
|
||||
void (*const V1FireProjectile_Functions[])(Entity*) = {
|
||||
V1FireProjectile_OnTick, sub_080AB2DC, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const V1FireProjectile_Actions[])(Entity*) = {
|
||||
V1FireProjectile_Init,
|
||||
V1FireProjectile_Action1,
|
||||
V1FireProjectile_Action2,
|
||||
V1FireProjectile_Action3,
|
||||
};
|
||||
const s8 gUnk_0812A4EC[] = { 16, 0, 64, -48, 80, -32, 80, 0, 80, 32, 64, 48, 32, 16, 48, 0, 32, -16,
|
||||
80, -64, 80, -64, 32, 0, 48, -32, 64, -16, 64, 16, 48, 32, 16, 16, 64, 16,
|
||||
64, 32, 48, 48, 32, 64, 16, 64, 16, 32, 32, 16, 80, 16, 80, 48, 64, 64,
|
||||
48, 80, 16, 80, 16, 48, 32, 32, 48, 16, 0, 16, -48, 48, -32, 64, 32, 64,
|
||||
48, 48, 80, 80, 0, 80, -80, 80, 0, 32, 64, 64, 48, 80, -48, 80, -64, 64,
|
||||
-16, 16, 0, 48, 16, 16, -16, 16, -64, 16, -64, 32, -48, 48, -32, 64, -16, 64,
|
||||
-16, 32, -32, 16, -80, 16, -80, 48, -64, 64, -48, 80, -16, 80, -16, 48, -32, 32,
|
||||
-48, 16, -16, 0, -64, -48, -80, -32, -80, 0, -80, 32, -64, 48, -32, 16, -48, 0,
|
||||
-32, -16, -80, -64, -80, -64, -32, 0, -48, -32, -64, -16, -64, 16, -48, 32 };
|
||||
@@ -5,8 +5,10 @@
|
||||
#include "random.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0812A7D4[])(Entity*);
|
||||
|
||||
extern void (*const V2Projectile_Functions[])(Entity*);
|
||||
extern void (*const gUnk_0812A7EC[])(Entity*);
|
||||
extern void (*const gUnk_0812A7F8[])(Entity*);
|
||||
extern void (*const gUnk_0812A800[])(Entity*);
|
||||
extern void (*const gUnk_0812A808[])(Entity*);
|
||||
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
@@ -14,13 +16,13 @@ extern void sub_08079D84(void);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
|
||||
void Projectile1F(Entity* this) {
|
||||
gUnk_0812A7D4[GetNextFunction(this)](this);
|
||||
void V2Projectile(Entity* this) {
|
||||
V2Projectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1F/sub_080ABBA8.inc", void sub_080ABBA8(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABBA8.inc", void sub_080ABBA8(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1F/sub_080ABBF4.inc", void sub_080ABBF4(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABBF4.inc", void sub_080ABBF4(Entity* this))
|
||||
|
||||
void sub_080ABC54(Entity* this) {
|
||||
if (sub_0806F520() == 0) {
|
||||
@@ -90,7 +92,7 @@ void sub_080ABD70(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1F/sub_080ABE04.inc", void sub_080ABE04(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABE04.inc", void sub_080ABE04(Entity* this))
|
||||
|
||||
void sub_080ABE88(Entity* this) {
|
||||
if (sub_08003FC4(this, 0x1800) == 0) {
|
||||
@@ -121,3 +123,25 @@ void sub_080ABF04(Entity* this) {
|
||||
sub_0806F69C(this);
|
||||
GetNextFrame(this);
|
||||
}
|
||||
|
||||
void (*const V2Projectile_Functions[])(Entity*) = {
|
||||
sub_080ABBA8, sub_080ABBF4, DeleteEntity, DeleteEntity, DeleteEntity, sub_080ABC54,
|
||||
};
|
||||
void (*const gUnk_0812A7EC[])(Entity*) = {
|
||||
sub_080ABCC4,
|
||||
sub_080ABD44,
|
||||
sub_080ABD70,
|
||||
};
|
||||
void (*const gUnk_0812A7F8[])(Entity*) = {
|
||||
sub_080ABE04,
|
||||
sub_080ABE88,
|
||||
};
|
||||
void (*const gUnk_0812A800[])(Entity*) = {
|
||||
sub_080ABEA8,
|
||||
sub_080ABF04,
|
||||
};
|
||||
void (*const gUnk_0812A808[])(Entity*) = {
|
||||
sub_080ABC84,
|
||||
nullsub_542,
|
||||
sub_080ABC90,
|
||||
};
|
||||
@@ -5,28 +5,30 @@
|
||||
#include "coord.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_0812A954[])(Entity*);
|
||||
|
||||
extern void (*const gUnk_0812A968[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void Projectile21(Entity* this) {
|
||||
gUnk_0812A954[GetNextFunction(this)](this);
|
||||
extern void (*const V3ElectricProjectile_Functions[])(Entity*);
|
||||
extern void (*const V3ElectricProjectile_Actions[])(Entity*);
|
||||
extern const u16 gUnk_0812A97C[];
|
||||
extern const u8 gUnk_0812A982[];
|
||||
extern const u8 gUnk_0812A98A[];
|
||||
|
||||
void V3ElectricProjectile(Entity* this) {
|
||||
V3ElectricProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080ABFCC(Entity* this) {
|
||||
gUnk_0812A968[this->action](this);
|
||||
void V3ElectricProjectile_OnTick(Entity* this) {
|
||||
V3ElectricProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080ABFE4(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile21/sub_080ABFEC.inc", void sub_080ABFEC(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v3ElectricProjectile/sub_080ABFEC.inc", void sub_080ABFEC(Entity* this))
|
||||
|
||||
void sub_080AC074(Entity* this) {
|
||||
void V3ElectricProjectile_Action1(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -52,7 +54,7 @@ void sub_080AC074(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080AC100(Entity* this) {
|
||||
void V3ElectricProjectile_Action2(Entity* this) {
|
||||
u8 bVar1;
|
||||
s32 iVar2;
|
||||
u32 uVar3;
|
||||
@@ -75,6 +77,20 @@ void sub_080AC100(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile21/sub_080AC168.inc", void sub_080AC168(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v3ElectricProjectile/sub_080AC168.inc", void sub_080AC168(Entity* this))
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile21/sub_080AC200.inc", void sub_080AC200(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/v3ElectricProjectile/sub_080AC200.inc", void sub_080AC200(Entity* this))
|
||||
|
||||
void (*const V3ElectricProjectile_Functions[])(Entity*) = {
|
||||
V3ElectricProjectile_OnTick, sub_080ABFE4, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
void (*const V3ElectricProjectile_Actions[])(Entity*) = {
|
||||
sub_080ABFEC, V3ElectricProjectile_Action1, V3ElectricProjectile_Action2, sub_080AC168, sub_080AC200,
|
||||
};
|
||||
const u16 gUnk_0812A97C[] = { 352, 480, 480 };
|
||||
const u8 gUnk_0812A982[] = {
|
||||
5, 6, 7, 8, 5, 6, 7, 6,
|
||||
};
|
||||
const u8 gUnk_0812A98A[] = {
|
||||
6, 9, 9, 12, 6, 9, 9, 9, 0, 0,
|
||||
};
|
||||
@@ -3,16 +3,16 @@
|
||||
#include "player.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0812A84C[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
void Projectile20(Entity* this) {
|
||||
gUnk_0812A84C[GetNextFunction(this)](this);
|
||||
extern void (*const V3HandProjectile_Functions[])(Entity*);
|
||||
|
||||
void V3HandProjectile(Entity* this) {
|
||||
V3HandProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_080ABF40(Entity* this) {
|
||||
void V3HandProjectile_OnTick(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->direction = GetFacingDirection(this, &gPlayerEntity);
|
||||
@@ -35,3 +35,7 @@ void sub_080ABF40(Entity* this) {
|
||||
void sub_080ABFA8(Entity* this) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
|
||||
void (*const V3HandProjectile_Functions[])(Entity*) = {
|
||||
V3HandProjectile_OnTick, sub_080ABFA8, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
};
|
||||
@@ -0,0 +1,73 @@
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "audio.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
|
||||
extern void (*const V3TennisBallProjectile_Functions[])(Entity*);
|
||||
extern void (*const V3TennisBallProjectile_Actions[])(Entity*);
|
||||
|
||||
void sub_080ACB90(Entity*);
|
||||
|
||||
void V3TennisBallProjectile(Entity* this) {
|
||||
V3TennisBallProjectile_Functions[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void V3TennisBallProjectile_OnTick(Entity* this) {
|
||||
V3TennisBallProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/v3TennisBallProjectile/sub_080ACA68.inc", void sub_080ACA68(Entity* this))
|
||||
|
||||
void V3TennisBallProjectile_Init(Entity* this) {
|
||||
this->action = 1;
|
||||
this->direction = 0x10;
|
||||
this->height.HALF.HI = 0xfffc;
|
||||
this->attachedEntity = NULL;
|
||||
InitializeAnimation(this, 7);
|
||||
SoundReq(SFX_199);
|
||||
}
|
||||
|
||||
void V3TennisBallProjectile_Action1(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
GetNextFrame(this);
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void V3TennisBallProjectile_Action2(Entity* this) {
|
||||
sub_080AF090(this);
|
||||
if (this->collisions != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
GetNextFrame(this);
|
||||
sub_080ACB90(this);
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/v3TennisBallProjectile/sub_080ACB40.inc", void sub_080ACB40(Entity* this))
|
||||
|
||||
void sub_080ACB90(Entity* this) {
|
||||
Entity* parent = this->parent;
|
||||
if ((this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI <= parent->y.HALF.HI)) {
|
||||
parent->field_0xf = 1;
|
||||
CreateFx(this, 0x1f, 0x40);
|
||||
EnqueueSFX(SFX_ITEM_GLOVES_KNOCKBACK);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void (*const V3TennisBallProjectile_Functions[])(Entity*) = {
|
||||
V3TennisBallProjectile_OnTick, sub_080ACA68, DeleteEntity, DeleteEntity, DeleteEntity,
|
||||
V3TennisBallProjectile_OnTick,
|
||||
};
|
||||
void (*const V3TennisBallProjectile_Actions[])(Entity*) = {
|
||||
V3TennisBallProjectile_Init,
|
||||
V3TennisBallProjectile_Action1,
|
||||
V3TennisBallProjectile_Action2,
|
||||
};
|
||||
@@ -3,20 +3,20 @@
|
||||
#include "functions.h"
|
||||
#include "audio.h"
|
||||
|
||||
extern void (*const gUnk_0812979C[])(Entity*);
|
||||
|
||||
extern s32 sub_080AF090(Entity*);
|
||||
extern s32 sub_080A7EB0(Entity*);
|
||||
extern void sub_08016AD2(Entity*);
|
||||
|
||||
void Projectile7(Entity* this) {
|
||||
extern void (*const WindProjectile_Actions[])(Entity*);
|
||||
|
||||
void WindProjectile(Entity* this) {
|
||||
if (GetNextFunction(this) != 0) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
gUnk_0812979C[this->action](this);
|
||||
WindProjectile_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_080A8A90(Entity* this) {
|
||||
void WindProjectile_Init(Entity* this) {
|
||||
if (this->type == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->direction >> 3);
|
||||
@@ -27,11 +27,9 @@ void sub_080A8A90(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8AC8(Entity* this) {
|
||||
void WindProjectile_Action1(Entity* this) {
|
||||
u32 direction;
|
||||
Entity* parent;
|
||||
|
||||
parent = this->parent;
|
||||
Entity* parent = this->parent;
|
||||
if (parent == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
@@ -59,7 +57,7 @@ void sub_080A8AC8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8B38(Entity* this) {
|
||||
void WindProjectile_Action2(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if (sub_080AF090(this) != 0) {
|
||||
if (sub_080A7EB0(this) != 0) {
|
||||
@@ -74,9 +72,16 @@ void sub_080A8B38(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080A8B78(Entity* this) {
|
||||
void WindProjectile_Action3(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void (*const WindProjectile_Actions[])(Entity*) = {
|
||||
WindProjectile_Init,
|
||||
WindProjectile_Action1,
|
||||
WindProjectile_Action2,
|
||||
WindProjectile_Action3,
|
||||
};
|
||||
@@ -3,15 +3,18 @@
|
||||
#include "functions.h"
|
||||
#include "utils.h"
|
||||
|
||||
extern void (*const gUnk_0812A6B4[])(Entity*);
|
||||
extern void (*const Winder_Actions[])(Entity*);
|
||||
extern const u8 gUnk_0812A6BC[];
|
||||
extern const u8 gUnk_0812A6C4[];
|
||||
|
||||
void sub_080AB9DC(Entity*);
|
||||
|
||||
void Projectile1D(Entity* this) {
|
||||
gUnk_0812A6B4[this->action](this);
|
||||
void Winder(Entity* this) {
|
||||
Winder_Actions[this->action](this);
|
||||
sub_080AB9DC(this);
|
||||
}
|
||||
|
||||
void sub_080AB8E8(Entity* this) {
|
||||
void Winder_Init(Entity* this) {
|
||||
Entity* entity;
|
||||
u16* puVar3;
|
||||
s32 index;
|
||||
@@ -25,7 +28,7 @@ void sub_080AB8E8(Entity* this) {
|
||||
}
|
||||
InitializeAnimation(this, 0);
|
||||
if (this->type < 4) {
|
||||
entity = sub_080A7EE0(0x1d);
|
||||
entity = CreateProjectile(0x1d);
|
||||
entity->type = this->type + 1;
|
||||
entity->parent = this->parent;
|
||||
entity->attachedEntity = this;
|
||||
@@ -41,7 +44,7 @@ void sub_080AB8E8(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1D/sub_080AB950.inc", void sub_080AB950(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/winder/sub_080AB950.inc", void sub_080AB950(Entity* this))
|
||||
|
||||
void sub_080AB9DC(Entity* this) {
|
||||
MemCopy(&this->field_0x6c, &this->field_0x68, 0x1c);
|
||||
@@ -49,4 +52,15 @@ void sub_080AB9DC(Entity* this) {
|
||||
this->field_0x86.HWORD = this->y.HALF.HI;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/projectile1D/sub_080AB9FC.inc", void sub_080AB9FC(Entity* this))
|
||||
ASM_FUNC("asm/non_matching/winder/sub_080AB9FC.inc", void sub_080AB9FC(Entity* this))
|
||||
|
||||
void (*const Winder_Actions[])(Entity*) = {
|
||||
Winder_Init,
|
||||
sub_080AB950,
|
||||
};
|
||||
const u8 gUnk_0812A6BC[] = {
|
||||
8, 24, 0, 16, 8, 24, 0, 16,
|
||||
};
|
||||
const u8 gUnk_0812A6C4[] = {
|
||||
14, 0, 0, 224, 224, 0, 0, 14,
|
||||
};
|
||||
Reference in New Issue
Block a user