document link fire

This commit is contained in:
Henny022p
2026-09-27 19:47:48 +02:00
parent 5ab63f00e5
commit ecae1f4ded
13 changed files with 39 additions and 39 deletions
+6 -6
View File
@@ -263,10 +263,10 @@ typedef struct {
typedef enum {
INPUT_USE_ITEM1 = 0x1, // A
INPUT_USE_ITEM2 = 0x2, // B
INPUT_INTERACT = 0x8, // A sub_080782C0, sub_0807953C, PlayerUpdateSwimming, sub_08076518. ItemForSale_Action2
INPUT_CANCEL = 0x10, // B sub_0807953C, ToggleDiving, sub_08076518, ItemForSale_Action2
INPUT_CONTEXT = 0x20, // R sub_0807953C
INPUT_40 = 0x40, // A CrenelBeanSprout_Action1
INPUT_INTERACT = 0x8, // A sub_080782C0, PlayerInputPressed, PlayerUpdateSwimming, sub_08076518, ItemForSale_Action2
INPUT_CANCEL = 0x10, // B PlayerInputPressed, ToggleDiving, sub_08076518, ItemForSale_Action2
INPUT_CONTEXT = 0x20, // R PlayerInputPressed
INPUT_40 = 0x40, // A CrenelBeanSprout_Action1
INPUT_ACTION =
0x80, // R sub_08073584, IsPreventedFromUsingItem, sub_080782C0, CrenelBeanSprout_Action1, ItemForSale_Action2
INPUT_RIGHT = 0x100,
@@ -763,7 +763,7 @@ void InitItemGetSequence(u32, u32, u32);
void sub_0807B7D8(u32 tileType, u32 tilePos, u32 layer);
void SetInteractableObjectCollision(Entity*, u32, u32, const void*);
void sub_08079D84(void);
u32 sub_0807953C(void);
u32 PlayerInputPressed(void);
void sub_0807BB68(const s16*, u32, u32);
void SetTileByIndex(u32 tileIndex, u32 tilePos, u32 layer);
void RestorePrevTileEntity(u32 tilePos, u32 layer);
@@ -801,7 +801,7 @@ void PausePlayer(void);
void sub_08078E84(Entity*, Entity*);
void sub_08078FB0(Entity*);
void sub_080792BC(s32, u32, u32);
u32 sub_0807953C(void);
u32 PlayerInputPressed(void);
void sub_08079BD8(Entity*);
u32 sub_08079D48();
void sub_08079D84(void);
+3 -3
View File
@@ -326,7 +326,7 @@ CollisionResult sub_08017F40(Entity* org, Entity* tgt, u32 direction, ColSetting
CollisionResult sub_0801802C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_08017DD4(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_080180E8(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult CollisionFire(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_08017C40(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_08017D6C(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
CollisionResult sub_08017D28(Entity* org, Entity* tgt, u32 direction, ColSettings* settings);
@@ -351,7 +351,7 @@ const CollisionHandler gCollisionHandlers[] = {
sub_0801802C,
sub_08017DD4,
sub_080180E8,
sub_08017BBC,
CollisionFire,
sub_08017C40,
sub_08017D6C,
sub_08017D28,
@@ -409,7 +409,7 @@ CollisionResult sub_08017B58(Entity* org, Entity* tgt, u32 direction, ColSetting
return RESULT_COLLISION;
}
CollisionResult sub_08017BBC(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
CollisionResult CollisionFire(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) {
if ((gPlayerState.flags & (PL_BUSY | PL_MINISH | PL_BURNING | PL_IN_MINECART)) == 0) {
Entity* e = CreateObject(LINK_FIRE, 1, 0);
if (e != NULL) {
+1 -1
View File
@@ -237,7 +237,7 @@ void sub_08021B64(BeetleEntity* this) {
s32 iVar4 = 1;
if (gPlayerState.framestate != PL_STATE_JUMP && gPlayerState.framestate != PL_STATE_CAPE) {
if (sub_0807953C())
if (PlayerInputPressed())
iVar4 = super->type * 3 + 8;
iVar4 = super->timer - iVar4;
+1 -1
View File
@@ -301,7 +301,7 @@ void Enemy50_Action9(Enemy50Entity* this) {
if ((super->frame & 1) != 0) {
sub_0803F6C0(this);
}
if (sub_0807953C()) {
if (PlayerInputPressed()) {
this->unk_78 += 8;
}
if (gPlayerEntity.base.health == 0) {
+1 -1
View File
@@ -257,7 +257,7 @@ void Ghini_Action9(GhiniEntity* this) {
if ((super->frame & 1) != 0) {
sub_0803F6C0(this);
}
if (sub_0807953C() != 0) {
if (PlayerInputPressed() != 0) {
this->unk_78 += 0xc;
}
if (gPlayerEntity.base.health == 0) {
+1 -1
View File
@@ -315,7 +315,7 @@ void sub_080379BC(GibdoEntity* this) {
}
bool32 sub_080379EC(GibdoEntity* this) {
if (sub_0807953C() != 0) {
if (PlayerInputPressed() != 0) {
if (--super->timer == 0) {
sub_08037A58(this);
return TRUE;
+1 -1
View File
@@ -191,7 +191,7 @@ void sub_0802805C(LikeLikeEntity* this) {
UpdateAnimationVariableFrames(super, 2);
if (sub_0807953C()) {
if (PlayerInputPressed()) {
u32 tmp2 = Random();
u32 tmp3 = super->subtimer + 1;
tmp3 += (tmp2 & 1);
+1 -1
View File
@@ -832,7 +832,7 @@ u32 sub_08024E34(void) {
void sub_08024E4C(PestoEntity* this) {
if (this->unk_83 == 3) {
super->subtimer = ++super->subtimer & 0x1f;
if (sub_0807953C()) {
if (PlayerInputPressed()) {
u32 r = Random();
this->unk_84++;
r &= 1;
+1 -1
View File
@@ -171,7 +171,7 @@ void sub_0802953C(RupeeLikeEntity* this) {
sub_080296C8(this);
sub_080296C8(this);
if (sub_0807953C() != 0) {
if (PlayerInputPressed() != 0) {
super->subtimer++;
}
if (super->timer != 0) {
+19 -19
View File
@@ -14,54 +14,54 @@ typedef struct {
/*0x6c*/ u16 unk_6c;
} LinkFireEntity;
void sub_0808DDB4(LinkFireEntity*);
void sub_0808DDE0(LinkFireEntity*);
void sub_0808DDE8(LinkFireEntity*);
void LinkFire_Init(LinkFireEntity*);
void LinkFire_Update_Type0(LinkFireEntity*);
void LinkFire_Update_Type1(LinkFireEntity*);
void LinkFire(LinkFireEntity* this) {
static void (*const gUnk_081217A8[])(LinkFireEntity*) = {
sub_0808DDB4,
sub_0808DDE0,
static void (*const sLinkFire_Type0_Actions[])(LinkFireEntity*) = {
LinkFire_Init,
LinkFire_Update_Type0,
};
static void (*const gUnk_081217B0[])(LinkFireEntity*) = {
sub_0808DDB4,
sub_0808DDE8,
static void (*const sLinkFire_Type1_Actions[])(LinkFireEntity*) = {
LinkFire_Init,
LinkFire_Update_Type1,
};
if (super->type != 0) {
gUnk_081217B0[super->action](this);
sLinkFire_Type1_Actions[super->action](this);
} else {
gUnk_081217A8[super->action](this);
sLinkFire_Type0_Actions[super->action](this);
}
}
void sub_0808DDB4(LinkFireEntity* this) {
void LinkFire_Init(LinkFireEntity* this) {
super->action = 1;
if (super->type != 0) {
super->timer = 120;
this->unk_6c = 0xf0;
InitializeAnimation(super, 0);
sub_0808DDE8(this);
LinkFire_Update_Type1(this);
}
}
void sub_0808DDE0(LinkFireEntity* this) {
void LinkFire_Update_Type0(LinkFireEntity* this) {
DeleteThisEntity();
}
void sub_0808DDE8(LinkFireEntity* this) {
static const s8 gUnk_081217B8[] = { 0, -6, 0, 6 };
void LinkFire_Update_Type1(LinkFireEntity* this) {
static const s8 sLinkFire_PositionOffsets[] = { 0, -6, 0, 6 };
Entity* player;
this->unk_6c--;
if (sub_0807953C()) {
if (PlayerInputPressed()) {
super->subtimer++;
}
if (((0x1e < super->subtimer) || ((gPlayerState.flags & (PL_CAPTURED | PL_FROZEN | PL_IN_MINECART)) != 0)) ||
if ((30 < super->subtimer) || ((gPlayerState.flags & (PL_CAPTURED | PL_FROZEN | PL_IN_MINECART)) != 0) ||
(this->unk_6c == 0)) {
gPlayerState.flags &= ~PL_BURNING;
DeleteThisEntity();
}
player = &gPlayerEntity.base;
super->x.HALF.HI = (s8)gUnk_081217B8[gPlayerEntity.base.animationState >> 1] + player->x.HALF.HI;
super->x.HALF.HI = sLinkFire_PositionOffsets[gPlayerEntity.base.animationState >> 1] + player->x.HALF.HI;
super->y.HALF.HI = gPlayerEntity.base.y.HALF.HI + -6;
super->z = gPlayerEntity.base.z;
super->collisionLayer = gPlayerEntity.base.collisionLayer;
+2 -2
View File
@@ -1631,7 +1631,7 @@ static void sub_08071E04(PlayerEntity* this) {
}
sub_080792D8();
if (sub_0807953C())
if (PlayerInputPressed())
super->timer -= 2;
else
super->timer--;
@@ -1723,7 +1723,7 @@ static void PlayerFrozenUpdate(PlayerEntity* this) {
sub_08079708(super);
} else {
if (gPlayerState.flags & PL_FROZEN) {
if (sub_0807953C() != 0) {
if (PlayerInputPressed() != 0) {
super->timer -= 3;
super->spriteOffsetX = 2;
} else {
+1 -1
View File
@@ -1982,7 +1982,7 @@ void sub_08079520(Entity* this) {
}
}
u32 sub_0807953C(void) {
u32 PlayerInputPressed(void) {
u32 tmp = INPUT_ANY_DIRECTION | INPUT_CONTEXT | INPUT_CANCEL | INPUT_INTERACT;
return gPlayerState.playerInput.newInput & tmp;
}
+1 -1
View File
@@ -218,7 +218,7 @@ void V1DarkMagicProjectile_Action3(V1DarkMagicProjectileEntity* this) {
}
void sub_080AAF74(V1DarkMagicProjectileEntity* this) {
if (sub_0807953C() != 0) {
if (PlayerInputPressed() != 0) {
this->unk_80 += (Random() & 1) + 1;
}
if (++super->timer == 0x3c) {