Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyromuffin committed Sep 19, 2024
1 parent c20e982 commit 8ee7949
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
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

0 comments on commit 8ee7949

Please sign in to comment.