Decomp w_001 func_ptr_80170008 (#1085)

This commit is contained in:
Ross Squires 2024-02-25 13:31:34 -05:00 committed by GitHub
parent 3bda9c043f
commit 37326838d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,7 +8,53 @@ INCLUDE_ASM("weapon/nonmatchings/w_001", EntityWeaponAttack);
INCLUDE_ASM("weapon/nonmatchings/w_001", func_ptr_80170004);
INCLUDE_ASM("weapon/nonmatchings/w_001", func_ptr_80170008);
extern AnimationFrame D_B000_8017AFC8[];
void func_ptr_80170008(Entity* self) {
switch (self->step) {
case 0:
self->flags = FLAG_UNK_08000000 | FLAG_UNK_100000;
self->animSet = 9;
self->unk4C = D_B000_8017AFC8;
self->zPriority = PLAYER.zPriority - 2;
self->facingLeft = (PLAYER.facingLeft + 1) & 1;
SetSpeedX(FIX(-4.5));
self->palette = 0x81B0;
self->drawMode = 0x30;
self->posX.val += self->velocityX * 6;
self->posY.i.hi -= 0xD;
if (PLAYER.drawFlags & FLAG_DRAW_ROTY) {
self->posY.i.hi -= 0x3;
}
self->drawFlags = FLAG_DRAW_ROTX | FLAG_DRAW_ROTY;
self->rotY = 0x60;
self->rotX = 0x60;
self->ext.factory.unkAE = self->ext.factory.parent->ext.factory.unkAE;
SetWeaponProperties(self, 0);
self->enemyId = self->ext.factory.parent->enemyId;
self->hitboxWidth = 10;
self->hitboxHeight = 8;
g_api.PlaySfx(0x62C);
self->step++;
break;
case 1:
if (self->hitFlags) {
DestroyEntity(self);
return;
}
self->posX.val += self->velocityX;
self->rotX += 0x10;
self->rotY += 0x10;
if (self->rotY >= 0x101) {
self->rotY = 0x100;
}
if (self->rotX >= 0x181) {
self->rotX = 0x180;
}
break;
}
}
void func_ptr_8017000C(Entity* self) {}