Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompile EntityUnkId4B #1629

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion src/st/no3/4AFF0.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,66 @@ void func_801CF6D8(Entity* arg0) {

INCLUDE_ASM("st/no3/nonmatchings/4AFF0", EntityWarg);

INCLUDE_ASM("st/no3/nonmatchings/4AFF0", EntityUnkId4B);
// func_psp_09254348
void EntityUnkId4B(Entity* self) {
u16 lastAnimFrame;
Entity* previous;
s16* hitboxPtr;

previous = self - 1;

if (!self->step) {
InitializeEntity(&D_80180B9C);
self->animCurFrame = 0;
self->hitPoints = 0x7FFF;
}

self->posX.i.hi = previous->posX.i.hi;
self->posY.i.hi = previous->posY.i.hi;
self->facingLeft = previous->facingLeft;
lastAnimFrame = previous->animCurFrame;

if (lastAnimFrame) {

if (self->params) {

if (lastAnimFrame >= 109) {
lastAnimFrame -= 108;
} else if (lastAnimFrame >= 82) {
lastAnimFrame -= 62;
} else if (lastAnimFrame >= 76) {
lastAnimFrame -= 59;
} else if (lastAnimFrame >= 63) {
lastAnimFrame -= 56;
} else if (lastAnimFrame >= 51) {
lastAnimFrame -= 50;
} else {
lastAnimFrame -= 49;
}
hitboxPtr = &D_801836BC[lastAnimFrame * 8];

} else {
if (previous->params) {
if (lastAnimFrame >= 86 || lastAnimFrame >= 57) {
lastAnimFrame -= 57;
} else {
lastAnimFrame = 13;
}
} else if (lastAnimFrame >= 96) {
lastAnimFrame -= 48;
} else {
lastAnimFrame -= 1;
}
hitboxPtr = &D_801832EC[lastAnimFrame * 8];
}

hitboxPtr = hitboxPtr + 4;
self->hitboxOffX = *hitboxPtr++;
self->hitboxOffY = *hitboxPtr++;
self->hitboxWidth = *hitboxPtr++;
self->hitboxHeight = *hitboxPtr;
}
}

// A single "puff" of the warg explosion animation, transparent
void EntityWargExplosionPuffTransparent(Entity* entity) {
Expand Down
3 changes: 3 additions & 0 deletions src/st/no3/no3.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ extern const char* D_80181ACC[];
extern s16 D_80181AD4[];
extern s16 D_80181AE0[];
extern Point16 D_80181AEC[];
extern s16 D_801832EC[];
extern s16 D_801836BC[];
extern u16 D_80180B9C;

// *** EntityDeath Animations *** //
extern u8 D_80181B04[];
Expand Down
Loading