Skip to content

Commit

Permalink
Decompile no3 EntityUnkId30 (#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshSchreuder authored Sep 16, 2024
1 parent d3875f7 commit e4796ea
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
57 changes: 56 additions & 1 deletion src/st/no3/48A84.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,62 @@ void func_801CC90C(Entity* arg0) {
// stronger version of warg with jump and flame attack
INCLUDE_ASM("st/no3/nonmatchings/48A84", EntityStrongWarg);

INCLUDE_ASM("st/no3/nonmatchings/48A84", EntityUnkId30);
void EntityUnkId30(Entity* self) {
Entity* entity;
u16 animCurFrame;
u16* hitboxPtr;

entity = self - 1;
if (self->step == 0) {
if (self->params != 0) {
InitializeEntity(D_80180B30);
self->hitboxState = 0;
} else {
if (entity->params != 0) {
InitializeEntity(D_80180B30);
} else {
InitializeEntity(D_80180B24);
}
}
self->animCurFrame = 0;
self->hitPoints = 32767;
}
self->posX.i.hi = entity->posX.i.hi;
self->posY.i.hi = entity->posY.i.hi;
self->facingLeft = entity->facingLeft;
animCurFrame = entity->animCurFrame;

if (animCurFrame != 0) {
if (self->params != 0) {
if (animCurFrame < 63) {
animCurFrame = 0;
} else {
animCurFrame -= 56;
}
hitboxPtr = &D_80182E1C[animCurFrame * 8];
} else {
if (entity->params != 0) {
if (animCurFrame >= 86 || animCurFrame >= 57) {
animCurFrame -= 57;
} else {
animCurFrame = 13;
}
} else {
if (animCurFrame >= 96) {
animCurFrame -= 48;
} else {
animCurFrame -= 1;
}
}
hitboxPtr = &D_80182A4C[animCurFrame * 8];
}
hitboxPtr += 4;
self->hitboxOffX = *hitboxPtr++;
self->hitboxOffY = *hitboxPtr++;
self->hitboxWidth = *hitboxPtr++;
self->hitboxHeight = *hitboxPtr++;
}
}

INCLUDE_ASM("st/no3/nonmatchings/48A84", EntityUnkId31);

Expand Down
4 changes: 4 additions & 0 deletions src/st/no3/no3.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,15 @@ extern u16 g_InitializeData0[];
extern u16 g_InitializeEntityData0[];
extern s16 D_80182A38[];
extern u8 D_80182A48[];
extern u16 D_80182A4C[];
extern u16 D_80182E1C[];
extern u16 D_80180AD0[];
extern u16 g_EInitGeneric[];
extern u16 D_80180AF4[];
extern u16 g_eInitGeneric2[];
extern u16 D_80180B18[];
extern u16 D_80180B24[];
extern u16 D_80180B30[];
extern u16 D_80180B48[];
extern u16 D_80180B54[];
extern u16 D_80180B6C[];
Expand Down

0 comments on commit e4796ea

Please sign in to comment.