mirror of
https://github.com/zeldaret/tmc
synced 2026-06-03 02:30:01 -04:00
Match sub_0801B938 + data
This commit is contained in:
@@ -3,17 +3,21 @@
|
||||
#include "player.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void (*const gUnk_080B7840[])(Entity*);
|
||||
|
||||
extern void sub_08079BD8(Entity*);
|
||||
void sub_0801B8FC(Entity*);
|
||||
extern Entity* sub_08008782(Entity*, u32, s32, s32);
|
||||
|
||||
void sub_0801B8FC(Entity*);
|
||||
void sub_0801B8B0(Entity*);
|
||||
void sub_0801B938(Entity*);
|
||||
|
||||
extern void sub_08017744(Entity*);
|
||||
|
||||
void PlayerItemC(Entity* this) {
|
||||
gUnk_080B7840[this->action](this);
|
||||
static void (*const PlayerItemC_Actions[])(Entity*) = {
|
||||
sub_0801B8B0,
|
||||
sub_0801B8FC,
|
||||
};
|
||||
PlayerItemC_Actions[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0801B8B0(Entity* this) {
|
||||
@@ -48,7 +52,36 @@ void sub_0801B8FC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/playerItemC/sub_0801B938.inc", void sub_0801B938(Entity* this))
|
||||
void sub_0801B938(Entity* this) {
|
||||
static const s8 gUnk_080B7848[] = {
|
||||
0, -15, 12, -3, 0, 9, -12, -3,
|
||||
};
|
||||
static const Hitbox gUnk_080B7850[] = {
|
||||
{ 0, -18, { 0 }, 4, 8 },
|
||||
{ 16, 0, { 0 }, 8, 4 },
|
||||
{ 2, 11, { 0 }, 4, 8 },
|
||||
{ -16, 0, { 0 }, 8, 4 },
|
||||
};
|
||||
const s8* ptr;
|
||||
|
||||
if ((this->animationState & 2)) {
|
||||
this->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX ^ 1;
|
||||
} else {
|
||||
this->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX;
|
||||
}
|
||||
|
||||
if ((u8)(gPlayerEntity.animIndex + 0x68) < 4) {
|
||||
this->frameIndex = gPlayerEntity.frameIndex + 0x2e;
|
||||
sub_080042D0(this, this->frameIndex, this->spriteIndex);
|
||||
} else {
|
||||
this->frameIndex = 0xff;
|
||||
}
|
||||
|
||||
this->hitbox = (Hitbox*)&gUnk_080B7850[this->animationState >> 1];
|
||||
ptr = &gUnk_080B7848[(this->animationState >> 1) * 2];
|
||||
sub_08008782(this, -(gPlayerState.field_0xac & 8) != 0, ptr[0], ptr[1]);
|
||||
sub_08078E84(this, &gPlayerEntity);
|
||||
}
|
||||
|
||||
void sub_0801B9F0(Entity* this) {
|
||||
COLLISION_OFF(this);
|
||||
|
||||
Reference in New Issue
Block a user