mirror of
https://github.com/zeldaret/tmc
synced 2026-08-18 21:48:21 -04:00
Matches from site(Henny022p,octorock,Léo Lam,ThothWhatsThis)
This commit is contained in:
@@ -515,7 +515,7 @@ void sub_0802AF9C(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entity* this)) {
|
||||
void sub_0802AFC8(Entity* this) {
|
||||
u32 subtimer = this->subtimer;
|
||||
u32 flag = 8;
|
||||
if (subtimer < 0x29) {
|
||||
@@ -526,13 +526,12 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit
|
||||
} else {
|
||||
this->field_0x82.HWORD += 0x10;
|
||||
}
|
||||
tmp2 = this->field_0x82.HWORD;
|
||||
tmp = tmp2 & 0xf0;
|
||||
tmp = this->field_0x82.HWORD & 0xf0;
|
||||
if (tmp == 0 || tmp > 0x80) {
|
||||
this->field_0x82.HWORD ^= 0x8000;
|
||||
}
|
||||
tmp = 0x130 - (this->field_0x82.HWORD & 0xf0);
|
||||
SetAffineInfo(this, tmp, tmp, 0);
|
||||
tmp = this->field_0x82.HWORD & 0xf0;
|
||||
SetAffineInfo(this, 0x130 - tmp, 0x130 - tmp, 0);
|
||||
}
|
||||
if (this->subtimer & flag) {
|
||||
this->palette.b.b0 = this->palette.b.b4;
|
||||
@@ -540,7 +539,6 @@ NONMATCH("asm/non_matching/bombPeahat/sub_0802AFC8.inc", void sub_0802AFC8(Entit
|
||||
this->palette.b.b0 = 0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0802B048(Entity* this) {
|
||||
Entity* ent;
|
||||
|
||||
@@ -327,7 +327,7 @@ void ChuchuBoss_OnTick(ChuchuBossEntity* this) {
|
||||
gUnk_080CC1B0[super->action](this);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(ChuchuBossEntity* this)) {
|
||||
void sub_08025DD8(ChuchuBossEntity* this) {
|
||||
super->action = 1;
|
||||
if (super->type == 8) {
|
||||
super->type = 4;
|
||||
@@ -346,7 +346,7 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
|
||||
switch (super->type & 3) {
|
||||
Hitbox* hitbox;
|
||||
case 0:
|
||||
super->type2 = super->type & 3;
|
||||
super->type2 = super->type;
|
||||
this->unk_84 = zMalloc(sizeof(Helper));
|
||||
if (!this->unk_84 || !AllocMutableHitbox(super)) {
|
||||
GenericDeath(super);
|
||||
@@ -376,6 +376,7 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
|
||||
this->unk_68->base.y.HALF.HI = super->y.HALF.HI - 0xE;
|
||||
this->unk_68->base.timer = 0xE;
|
||||
this->unk_68->base.parent = super;
|
||||
MEMORY_BARRIER;
|
||||
this->unk_68->unk_68 = this;
|
||||
}
|
||||
super->parent = CreateEnemy(CHUCHU_BOSS, super->type | 2);
|
||||
@@ -385,6 +386,7 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
|
||||
super->parent->y.HALF.HI = this->unk_68->base.y.HALF.HI - 0x12;
|
||||
super->parent->timer = 0x12;
|
||||
super->parent->parent = (Entity*)this->unk_68;
|
||||
MEMORY_BARRIER;
|
||||
this->unk_68->base.child = super->parent;
|
||||
((ChuchuBossEntity*)super->parent)->unk_68 = this;
|
||||
}
|
||||
@@ -417,7 +419,9 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1 ... 3:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
hitbox = super->hitbox;
|
||||
if (!AllocMutableHitbox(super)) {
|
||||
this->unk_68->base.health = 0;
|
||||
@@ -437,7 +441,6 @@ NONMATCH("asm/non_matching/chuchuBoss/sub_08025DD8.inc", void sub_08025DD8(Chuch
|
||||
sub_08026060(this);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08026060(ChuchuBossEntity* this) {
|
||||
gUnk_080CC1C8[super->type](this);
|
||||
|
||||
+31
-36
@@ -167,69 +167,65 @@ void sub_080442A0(DustEntity* this) {
|
||||
|
||||
extern const u8 gUnk_080D15B4[];
|
||||
|
||||
NONMATCH("asm/non_matching/dust/sub_080442BC.inc", void sub_080442BC(DustEntity* this)) {
|
||||
u32 bVar1;
|
||||
void sub_080442BC(DustEntity* this) {
|
||||
u32 hitboxCount;
|
||||
u32 i;
|
||||
u32 tmp;
|
||||
const u8* ptr = gUnk_080D15B4;
|
||||
u8* ptr2;
|
||||
hitboxCount = HEAP->unk_0;
|
||||
|
||||
bVar1 = HEAP->unk_0;
|
||||
|
||||
for (i = 0; i < bVar1; i++) {
|
||||
tmp = 0;
|
||||
super->hitbox[i + 1].unk2[2] = ptr[0];
|
||||
super->hitbox[i + 1].unk2[3] = ptr[1];
|
||||
super->hitbox[i + 1].width = ptr[2];
|
||||
super->hitbox[i + 1].height = ptr[3];
|
||||
// hitbox is probably misused here.
|
||||
super->hitbox[i + 1].offset_x = tmp;
|
||||
super->hitbox[i + 2].offset_y = (s8)i;
|
||||
for (i = 0; i < hitboxCount; i++) {
|
||||
((Hitbox3D*)&super->hitbox[i])[1].offset_x = ptr[0];
|
||||
((Hitbox3D*)&super->hitbox[i])[1].offset_y = ptr[1];
|
||||
((Hitbox3D*)&super->hitbox[i])[1].unknown[0] = ptr[2];
|
||||
((Hitbox3D*)&super->hitbox[i])[1].unknown[1] = ptr[3];
|
||||
((Hitbox3D*)&super->hitbox[i])[1].unknown[2] = 0;
|
||||
((Hitbox3D*)&super->hitbox[i])[1].unknown[3] = i;
|
||||
}
|
||||
this->unk_74 = bVar1;
|
||||
this->unk_74 = hitboxCount;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
// heap and hitbox struct
|
||||
NONMATCH("asm/non_matching/dust/sub_08044310.inc", void sub_08044310(DustEntity* this)) {
|
||||
void sub_08044310(DustEntity* this) {
|
||||
Entity* iVar1;
|
||||
u32 bVar2;
|
||||
Hitbox* pHVar3;
|
||||
DustHeap* puVar4;
|
||||
u32 i;
|
||||
u8* puVar6;
|
||||
u32 uVar7;
|
||||
Hitbox* pHVar8;
|
||||
u8* pbVar9;
|
||||
u32 tmp;
|
||||
DustHeap* reg7;
|
||||
|
||||
uVar7 = 0xff;
|
||||
tmp = 0xff;
|
||||
switch (gPlayerEntity.animationState >> 1 & 3) {
|
||||
|
||||
switch (gPlayerEntity.animationState / 2 & 3) {
|
||||
case 0:
|
||||
for (i = 0; i < this->unk_74; i++) {
|
||||
if (((u8)super->hitbox[i + 2].offset_x == 0) && (tmp > (u32)super->hitbox[i + 1].unk2[3])) {
|
||||
if ((((Hitbox3D*)&super->hitbox[i])[1].unknown[2] == 0) &&
|
||||
(tmp > (u8)((Hitbox3D*)&super->hitbox[i])[1].offset_y)) {
|
||||
uVar7 = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for (i = 0; i < this->unk_74; i++) {
|
||||
if (((u8)super->hitbox[i + 2].offset_x == 0) && (tmp > (u8)super->hitbox[i + 1].width)) {
|
||||
if ((((Hitbox3D*)&super->hitbox[i])[1].unknown[2] == 0) &&
|
||||
(tmp > ((Hitbox3D*)&super->hitbox[i])[1].unknown[0])) {
|
||||
uVar7 = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
for (i = 0; i < this->unk_74; i++) {
|
||||
if ((u8)super->hitbox[i + 2].offset_x == 0 && (tmp > (u8)super->hitbox[i + 1].unk2[2])) {
|
||||
if ((((Hitbox3D*)&super->hitbox[i])[1].unknown[2] == 0) &&
|
||||
(tmp > (u8)((Hitbox3D*)&super->hitbox[i])[1].offset_x)) {
|
||||
uVar7 = i;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for (i = 0; i < this->unk_74; i++) {
|
||||
if (((u8)super->hitbox[i + 2].offset_x == 0) && (tmp > super->hitbox[i + 1].height)) {
|
||||
if ((((Hitbox3D*)&super->hitbox[i])[1].unknown[2] == 0) &&
|
||||
(tmp > ((Hitbox3D*)&super->hitbox[i])[1].unknown[1])) {
|
||||
uVar7 = i;
|
||||
}
|
||||
}
|
||||
@@ -239,9 +235,9 @@ NONMATCH("asm/non_matching/dust/sub_08044310.inc", void sub_08044310(DustEntity*
|
||||
if (uVar7 != 0xff) {
|
||||
super->hitbox[uVar7 + 2].offset_x = 1;
|
||||
HEAP->unk_0--;
|
||||
puVar4 = HEAP;
|
||||
bVar2 = puVar4->unk_0;
|
||||
pbVar9 = &puVar4->items[(u32)(u8)super->hitbox[uVar7 + 2].offset_y].unk_1;
|
||||
reg7 = HEAP + 1 + HEAP->unk_0 * 5;
|
||||
bVar2 = HEAP->unk_0;
|
||||
pbVar9 = &HEAP->items[(u32)(u8)super->hitbox[uVar7 + 2].offset_y].unk_0;
|
||||
iVar1 = CreateEnemy(DUST, 1);
|
||||
if (iVar1 != 0) {
|
||||
PositionRelative(super, iVar1, ((s8)*pbVar9 + 8) * 0x10000, ((s8)pbVar9[1] + 8) * 0x10000);
|
||||
@@ -254,18 +250,17 @@ NONMATCH("asm/non_matching/dust/sub_08044310.inc", void sub_08044310(DustEntity*
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
pbVar9[i] = (&puVar4->unk_0)[i];
|
||||
pbVar9[i] = reg7[i].unk_0;
|
||||
}
|
||||
|
||||
for (i = 0; i < this->unk_74; i++) {
|
||||
if ((u8)super->hitbox[i + 2].offset_y == HEAP->unk_0) {
|
||||
super->hitbox[i].unk2[3] = super->hitbox[uVar7 + 2].offset_y;
|
||||
return;
|
||||
if (((Hitbox3D*)&super->hitbox[i])[1].unknown[3] == HEAP->unk_0) {
|
||||
((Hitbox3D*)&super->hitbox[i])[1].unknown[3] = super->hitbox[uVar7 + 2].offset_y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08044498(DustEntity* this) {
|
||||
Entity* pEVar1;
|
||||
@@ -288,7 +283,7 @@ void sub_08044498(DustEntity* this) {
|
||||
|
||||
for (i = 0; i < uVar4; i++) {
|
||||
if (xdiff - pbVar2[i].unk_0 < 0x10 && ydiff - pbVar2[i].unk_1 < 0x10) {
|
||||
pEVar1 = CreateObject(SPECIAL_FX, 0x11, 0);
|
||||
pEVar1 = CreateObject(SPECIAL_FX, FX_DASH, 0);
|
||||
if (pEVar1 == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
+50
-61
@@ -307,16 +307,12 @@ void Gleerok_OnTick(GleerokEntity* this) {
|
||||
super->spriteRendering.b3 = 3;
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokEntity* this)) {
|
||||
u32 uvar1;
|
||||
Entity* ent;
|
||||
void sub_0802D3B8(GleerokEntity* this) {
|
||||
u32 tmp1;
|
||||
Gleerok_HeapStruct* heap;
|
||||
u32 val;
|
||||
Gleerok_HeapStruct2* ptr;
|
||||
Gleerok_HeapStruct2* ptr2;
|
||||
|
||||
if (CheckGlobalFlag(LV2_CLEAR)) {
|
||||
gScreen.lcd.displayControl &= 0xFDFF;
|
||||
gScreen.lcd.displayControl &= 0xfdff;
|
||||
sub_0807AABC(&gPlayerEntity);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
@@ -334,7 +330,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
this->unk_7c.WORD = 0x96;
|
||||
|
||||
sub_0802EB9C(this);
|
||||
this->unk_84 = zMalloc(0x54);
|
||||
this->unk_84 = zMalloc(sizeof(Gleerok_HeapStruct));
|
||||
heap = this->unk_84;
|
||||
|
||||
if (heap == NULL) {
|
||||
@@ -343,38 +339,36 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
}
|
||||
|
||||
super->myHeap = this->unk_84;
|
||||
uvar1 = 0;
|
||||
|
||||
do {
|
||||
for (tmp1 = 0; tmp1 < 5; tmp1++) {
|
||||
super->child = CreateEnemy(GLEEROK, 1);
|
||||
if (super->child != NULL) {
|
||||
super->child->type2 = uvar1 + 1;
|
||||
super->child->type2 = tmp1 + 1;
|
||||
super->child->collisionLayer = super->collisionLayer;
|
||||
super->child->x.HALF.HI = super->x.HALF.HI;
|
||||
super->child->y.HALF.HI = super->y.HALF.HI + ((uvar1 + 1) * 12);
|
||||
super->child->y.HALF.HI = super->y.HALF.HI + ((tmp1 + 1) * 12);
|
||||
super->child->parent = super;
|
||||
((GleerokEntity*)super->child)->unk_84 = this->unk_84;
|
||||
this->unk_84->entities[uvar1] = super->child;
|
||||
ptr = this->unk_84->filler;
|
||||
ptr2 = ptr + uvar1;
|
||||
ptr2[0].unk0.HALF.HI = 0x10;
|
||||
ptr2[6].unk0.HALF.HI = 0;
|
||||
ptr[13].unk0.HALF.HI = 0;
|
||||
MEMORY_BARRIER;
|
||||
heap->entities[tmp1] = super->child;
|
||||
heap->filler[tmp1].unk0.HALF.HI = 0x10;
|
||||
heap->filler2[tmp1].unk0.HALF.HI = 0;
|
||||
heap->unk_30[5] = 0;
|
||||
}
|
||||
} while (++uvar1 < 5);
|
||||
}
|
||||
|
||||
ent = CreateEnemy(GLEEROK, 2);
|
||||
super->child = ent;
|
||||
if (ent != NULL) {
|
||||
super->child = CreateEnemy(GLEEROK, 2);
|
||||
if (super->child != NULL) {
|
||||
super->child->collisionLayer = super->collisionLayer;
|
||||
super->child->x.HALF.HI = super->x.HALF.HI;
|
||||
super->child->y.HALF.HI = super->y.HALF.HI + ((uvar1 + 1) * 12);
|
||||
super->child->y.HALF.HI = super->y.HALF.HI + ((tmp1 + 1) * 12);
|
||||
super->child->parent = super;
|
||||
((GleerokEntity*)super->child)->unk_84 = this->unk_84;
|
||||
MEMORY_BARRIER;
|
||||
heap->ent2 = super->child;
|
||||
heap->filler[5].unk0.HALF.HI = 0x10;
|
||||
heap->filler2[5].unk0.HALF.HI = 0;
|
||||
heap->filler[13].unk0.HALF.HI = 0;
|
||||
heap->unk_30[5] = 0;
|
||||
}
|
||||
#ifndef EU
|
||||
gPlayerState.controlMode = CONTROL_DISABLED;
|
||||
@@ -386,6 +380,7 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
COLLISION_ON(super);
|
||||
super->flags2 |= 0x80;
|
||||
}
|
||||
|
||||
super->spritePriority.b0 = gUnk_080CD7C4[super->type2].unk0.HALF.HI;
|
||||
super->subtimer = 0;
|
||||
InitializeAnimation(super, 0x24);
|
||||
@@ -422,7 +417,6 @@ NONMATCH("asm/non_matching/gleerok/sub_0802D3B8.inc", void sub_0802D3B8(GleerokE
|
||||
sub_0802D86C(this);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0802D650(GleerokEntity* this) {
|
||||
#ifdef EU
|
||||
@@ -1221,17 +1215,15 @@ void sub_0802E4C0(GleerokEntity* this) {
|
||||
sub_0802E518(this);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokEntity* this)) {
|
||||
u32 index;
|
||||
void sub_0802E518(GleerokEntity* this) {
|
||||
Gleerok_HeapStruct* heap;
|
||||
s32 result;
|
||||
u32 r6;
|
||||
u32 sp4;
|
||||
u32 sp8;
|
||||
s32 r7;
|
||||
Gleerok_HeapStruct* heap = this->unk_84;
|
||||
CopyPosition(heap->entities[0]->parent, heap->entities[0]);
|
||||
heap->entities[0]->direction = heap->filler->unk0.HALF.HI;
|
||||
u32 r7;
|
||||
|
||||
r6 = heap->filler->unk0.HALF.HI;
|
||||
heap = this->unk_84;
|
||||
CopyPosition(heap->entities[0]->parent, heap->entities[0]);
|
||||
r6 = (heap->entities[0]->direction = heap->filler->unk0.HALF.HI);
|
||||
if (r6 > 0x10) {
|
||||
r6 ^= 0xf;
|
||||
r6 = (r6 + 1) & 0xf;
|
||||
@@ -1243,21 +1235,16 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
||||
|
||||
heap->entities[0]->speed = ((r6 ^ 0xf) + 0x12) << 8;
|
||||
LinearMoveUpdate(heap->entities[0]);
|
||||
sp4 = *(u32*)&heap->unk_30;
|
||||
sp8 = this->unk_80;
|
||||
|
||||
for (index = 0; index <= 4; index++) {
|
||||
s32 result;
|
||||
CopyPosition(heap->entities[index], heap->entities[index + 1]);
|
||||
result = FixedMul(gSineTable[heap->filler2[(index + 1)].unk0.HALF.HI * 8], (heap->unk_30)[r6] << 8);
|
||||
for (r6 = 0; r6 <= 4; r6++) {
|
||||
CopyPosition(heap->entities[r6], heap->entities[r6 + 1]);
|
||||
result = FixedMul(gSineTable[heap->filler2[(r6 + 1)].unk0.HALF.HI * 8], (heap->unk_30)[r6] << 8);
|
||||
result = FixedDiv(result, 0x100);
|
||||
result = FixedMul(gSineTable[heap->filler[(index + 1)].unk0.HALF.HI * 8], result);
|
||||
result = FixedDiv(result, 0x100);
|
||||
heap->entities[index]->x.WORD += result << 8;
|
||||
result = FixedMul(gSineTable[heap->filler[(r6 + 1)].unk0.HALF.HI * 8], result);
|
||||
heap->entities[r6 + 1]->x.WORD += FixedDiv(result, 0x100) << 8;
|
||||
|
||||
result = FixedMul(gSineTable[heap->filler2[(index + 1)].unk0.HALF.HI * 8 + 0x40], (heap->unk_30)[r6] << 8);
|
||||
result = FixedDiv(result, 0x100);
|
||||
heap->entities[index]->y.WORD -= result << 8;
|
||||
result = FixedMul(gSineTable[heap->filler2[(r6 + 1)].unk0.HALF.HI * 8 + 0x40], (heap->unk_30)[r6] << 8);
|
||||
heap->entities[r6 + 1]->y.WORD -= FixedDiv(result, 0x100) << 8;
|
||||
}
|
||||
|
||||
if (heap->ent2->timer == 24) {
|
||||
@@ -1275,17 +1262,16 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
||||
if (this->unk_80 == 0) {
|
||||
sub_0802E7CC(heap, 5, 0, 0);
|
||||
r7 = (heap->ent2->animationState + (heap->ent2->animationState >> 1));
|
||||
r7 = (r7 >> 2) + heap->ent2->timer;
|
||||
r7 >>= 2;
|
||||
r7 += heap->ent2->timer;
|
||||
} else {
|
||||
if (super->iframes == 0) {
|
||||
if ((super->animIndex != (heap->filler[5].unk0.HALF.HI >> 3) + 0x2f)) {
|
||||
r7 = (heap->filler[5].unk0.HALF.HI >> 3) + 0x28;
|
||||
} else if ((super->frame & ANIM_DONE) != 0) {
|
||||
r7 = (heap->filler[5].unk0.HALF.HI >> 3) + 0x28;
|
||||
} else {
|
||||
if ((super->frame & ANIM_DONE) != 0) {
|
||||
r7 = (heap->filler[5].unk0.HALF.HI >> 3) + 0x28;
|
||||
} else {
|
||||
r7 = super->animIndex;
|
||||
}
|
||||
r7 = super->animIndex;
|
||||
}
|
||||
} else {
|
||||
r7 = (heap->filler[5].unk0.HALF.HI >> 3) + 0x2f;
|
||||
@@ -1299,22 +1285,25 @@ NONMATCH("asm/non_matching/gleerok/sub_0802E518.inc", void sub_0802E518(GleerokE
|
||||
}
|
||||
}
|
||||
|
||||
for (index = 0; index <= 4; index++) {
|
||||
for (r6 = 0; r6 <= 4; r6++) {
|
||||
if (this->unk_80 == 0) {
|
||||
s8 x = 3;
|
||||
u32 val;
|
||||
sub_0802E7CC(heap, (u8)index, 0, 0);
|
||||
r7 = heap->entities[index]->animationState * 12;
|
||||
r7 += (((s32)heap->filler2[(index + 1)].unk0.HALF.HI) / 3) * 12;
|
||||
sub_0802E7CC(heap, (u8)r6, 0, 0);
|
||||
val = heap->entities[r6]->animationState;
|
||||
r7 = val + (val >> 1);
|
||||
r7 >>= 2;
|
||||
r7 += (u8)(heap->filler2[r6 + 1].unk0.HALF.HI / x) * 12;
|
||||
} else {
|
||||
r7 = heap->filler[index].unk0.HALF.HI >> 3;
|
||||
r7 += 0x48;
|
||||
u32 val;
|
||||
val = heap->filler[r6].unk0.HALF.HI >> 3;
|
||||
r7 = val + 0x48;
|
||||
}
|
||||
if (heap->entities[index]->animIndex != r7) {
|
||||
InitializeAnimation(heap->entities[index], r7);
|
||||
if (heap->entities[r6]->animIndex != r7) {
|
||||
InitializeAnimation(heap->entities[r6], r7);
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0802E768(Gleerok_HeapStruct* param_1) {
|
||||
u32 cVar1;
|
||||
|
||||
+119
-1
@@ -317,7 +317,125 @@ const u8 gUnk_080CF08C[] = {
|
||||
0, 4, 0, 0, 1, 5, 0, 0, 1, 4, 0, 0, 1, 3, 0, 0, 1, 2, 0, 0, 2, 1, 0, 0, 1, 1, 0, 0, 3, 6, 0, 0,
|
||||
};
|
||||
|
||||
ASM_FUNC("asm/non_matching/octorokBoss/OctorokBoss_Init.inc", void OctorokBoss_Init(OctorokBossEntity* this))
|
||||
void OctorokBoss_Init(OctorokBossEntity* this) {
|
||||
u32 leg;
|
||||
u32 tail;
|
||||
|
||||
super->action = ACTION1;
|
||||
super->spriteSettings.draw = 3;
|
||||
switch (super->type) {
|
||||
case WHOLE:
|
||||
super->spritePriority.b0 = 4;
|
||||
this->bossPhase = 0;
|
||||
super->timer = 1;
|
||||
this->heap = (OctorokBossHeap*)zMalloc(sizeof(OctorokBossHeap));
|
||||
if (this->heap == NULL) {
|
||||
// Kill this boss
|
||||
GenericDeath(super);
|
||||
return;
|
||||
} else {
|
||||
|
||||
super->myHeap = (u32*)this->heap;
|
||||
}
|
||||
MEMORY_BARRIER;
|
||||
(this->heap)->fallingStonesTimer = 0;
|
||||
(this->heap)->unk_0 = 2;
|
||||
(this->heap)->field_0x2 = 0;
|
||||
(this->heap)->tailCount = 5;
|
||||
super->spriteRendering.b0 = 3;
|
||||
this->field_0x6c.HALF.HI |= 1;
|
||||
this->unk_76 = 0xa0;
|
||||
this->unk_74 = 0xa0;
|
||||
this->angle.HWORD = 0;
|
||||
// Create legs
|
||||
for (leg = 0; leg < 4; leg++) {
|
||||
super->child = CreateEnemy(OCTOROK_BOSS, leg + 1);
|
||||
if (super->child != NULL) {
|
||||
CopyPosition(super, super->child);
|
||||
super->child->parent = super;
|
||||
((OctorokBossEntity*)super->child)->heap = this->heap;
|
||||
MEMORY_BARRIER;
|
||||
this->heap->legObjects[leg] = ((OctorokBossEntity*)super->child);
|
||||
}
|
||||
}
|
||||
// Create mouth
|
||||
super->child = CreateEnemy(OCTOROK_BOSS, MOUTH);
|
||||
if (super->child != NULL) {
|
||||
CopyPosition(super, super->child);
|
||||
super->child->parent = super;
|
||||
((OctorokBossEntity*)super->child)->heap = this->heap;
|
||||
}
|
||||
// Create tail end
|
||||
super->child = CreateEnemy(OCTOROK_BOSS, TAIL_END);
|
||||
if (super->child != NULL) {
|
||||
CopyPosition(super, super->child);
|
||||
super->child->parent = super;
|
||||
((OctorokBossEntity*)super->child)->heap = this->heap;
|
||||
MEMORY_BARRIER;
|
||||
(this->heap)->tailObjects[0] = (OctorokBossEntity*)super->child;
|
||||
}
|
||||
// Create tails
|
||||
|
||||
for (tail = 0; tail < 4; tail++) {
|
||||
super->child = CreateEnemy(OCTOROK_BOSS, TAIL);
|
||||
if (super->child != NULL) {
|
||||
super->child->type2 = tail;
|
||||
CopyPosition(super, super->child);
|
||||
super->child->parent = super;
|
||||
((OctorokBossEntity*)super->child)->heap = this->heap;
|
||||
MEMORY_BARRIER;
|
||||
this->heap->tailObjects[tail + 1] = (OctorokBossEntity*)super->child;
|
||||
}
|
||||
}
|
||||
super->action = INTRO;
|
||||
super->subAction = 0;
|
||||
this->timer = 0x3c;
|
||||
gPlayerEntity.spriteSettings.draw = 0;
|
||||
gPlayerEntity.x.HALF.HI = super->x.HALF.HI;
|
||||
gPlayerEntity.y.HALF.HI = super->y.HALF.HI - 0xa0;
|
||||
gRoomControls.camera_target = super;
|
||||
break;
|
||||
case LEG_BR:
|
||||
case LEG_FR:
|
||||
case LEG_FL:
|
||||
case LEG_BL:
|
||||
super->timer = 0x10;
|
||||
this->timer = 0;
|
||||
if ((super->type & 2) == 0) {
|
||||
super->subtimer = 2;
|
||||
} else {
|
||||
super->subtimer = 0xfe;
|
||||
}
|
||||
this->unk_74 = 0x100;
|
||||
if ((super->type & 1) == 0) {
|
||||
this->unk_76 = 0xff00;
|
||||
} else {
|
||||
this->unk_76 = 0x100;
|
||||
}
|
||||
break;
|
||||
case MOUTH:
|
||||
this->unk_76 = 0x100;
|
||||
this->unk_74 = 0x100;
|
||||
this->timer = 0x1c;
|
||||
this->heap->mouthObject = this;
|
||||
break;
|
||||
case TAIL_END:
|
||||
this->unk_76 = 0x100;
|
||||
this->unk_74 = 0x100;
|
||||
super->spritePriority.b0 = 0;
|
||||
this->timer = 0;
|
||||
super->timer = 0x10;
|
||||
super->subtimer = 1;
|
||||
GET_TAIL_RADIUS(this) = 0x80;
|
||||
break;
|
||||
}
|
||||
if (super->type != TAIL_END) {
|
||||
InitializeAnimation(super, gUnk_080CF08C[super->type * 4]);
|
||||
} else {
|
||||
InitAnimationForceUpdate(super, gUnk_080CF08C[super->type * 4]);
|
||||
}
|
||||
OctorokBoss_Action1(this);
|
||||
}
|
||||
|
||||
void OctorokBoss_Intro(OctorokBossEntity* this) {
|
||||
static void (*const OctorokBoss_Intro_SubActions[])(OctorokBossEntity*) = {
|
||||
|
||||
Reference in New Issue
Block a user