diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2022-08-09 18:48:05 +0200 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2022-08-09 18:56:13 +0200 |
| commit | ad44d63b73b52fa49f1698526e1d77b414a1991d (patch) | |
| tree | dde40030bc6013105e5f9ac1234c4e50707310f0 /src/object | |
| parent | dd59d70447cab4676e66895440fe6809d092bd31 (diff) | |
Document some player item stuff
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/barrelSpiderweb.c | 2 | ||||
| -rw-r--r-- | src/object/bigIceBlock.c | 2 | ||||
| -rw-r--r-- | src/object/bird.c | 2 | ||||
| -rw-r--r-- | src/object/book.c | 2 | ||||
| -rw-r--r-- | src/object/crenelBeanSprout.c | 8 | ||||
| -rw-r--r-- | src/object/fileScreenObjects.c | 4 | ||||
| -rw-r--r-- | src/object/frozenOctorok.c | 2 | ||||
| -rw-r--r-- | src/object/houseDoorExterior.c | 2 | ||||
| -rw-r--r-- | src/object/houseDoorInterior.c | 2 | ||||
| -rw-r--r-- | src/object/itemForSale.c | 6 | ||||
| -rw-r--r-- | src/object/lampParticle.c | 2 | ||||
| -rw-r--r-- | src/object/lilypadLarge.c | 2 | ||||
| -rw-r--r-- | src/object/macroPlayer.c | 5 | ||||
| -rw-r--r-- | src/object/minecart.c | 8 | ||||
| -rw-r--r-- | src/object/minishSizedEntrance.c | 2 | ||||
| -rw-r--r-- | src/object/octorokBossObject.c | 4 | ||||
| -rw-r--r-- | src/object/playerClone.c | 2 | ||||
| -rw-r--r-- | src/object/pot.c | 2 | ||||
| -rw-r--r-- | src/object/pullableMushroom.c | 6 | ||||
| -rw-r--r-- | src/object/pushableRock.c | 2 | ||||
| -rw-r--r-- | src/object/smallIceBlock.c | 2 | ||||
| -rw-r--r-- | src/object/smokeParticle.c | 2 | ||||
| -rw-r--r-- | src/object/swordParticle.c | 4 | ||||
| -rw-r--r-- | src/object/thunderbold.c | 2 | ||||
| -rw-r--r-- | src/object/unusedSkull.c | 2 |
25 files changed, 39 insertions, 40 deletions
diff --git a/src/object/barrelSpiderweb.c b/src/object/barrelSpiderweb.c index 4c608779..3e555ece 100644 --- a/src/object/barrelSpiderweb.c +++ b/src/object/barrelSpiderweb.c @@ -71,7 +71,7 @@ void sub_0808BBE0(BarrelSpiderwebEntity* this) { ptr = &gUnk_0812144C[diff * 2]; SetAffineInfo(super, ptr[0], ptr[1], 0); } else { - super->contactFlags &= 0x7f; + super->contactFlags &= ~0x80; } } diff --git a/src/object/bigIceBlock.c b/src/object/bigIceBlock.c index bb0fb7ca..8814fe63 100644 --- a/src/object/bigIceBlock.c +++ b/src/object/bigIceBlock.c @@ -97,7 +97,7 @@ void BigIceBlock_Action2(BigIceBlockEntity* this) { } super->action = 3; super->timer = 60; - super->flags &= 0x7f; + super->flags &= ~0x80; } void sub_08099880(BigIceBlockEntity* this) { diff --git a/src/object/bird.c b/src/object/bird.c index 55f080ad..e6243f22 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -238,7 +238,7 @@ void Bird_Type8(Entity* this) { PutAwayItems(); gPlayerState.swim_state = 0; gPlayerState.jump_status = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~0x80; gPlayerEntity.spriteSettings.draw = 0; gPriorityHandler.sys_priority = 6; gPauseMenuOptions.disabled = 1; diff --git a/src/object/book.c b/src/object/book.c index 941b5c52..ece50550 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -213,7 +213,7 @@ void Book_Action5(Entity* this) { u32 sub_0809B688(Entity* this) { u32 ret = EntityInRectRadius(this, &gPlayerEntity, 6, 12); - if (ret == 1 && gPlayerState.field_0xd != 16) { + if (ret == 1 && gPlayerState.direction != 16) { ret = 0; } diff --git a/src/object/crenelBeanSprout.c b/src/object/crenelBeanSprout.c index 0bf59d92..a0fb206d 100644 --- a/src/object/crenelBeanSprout.c +++ b/src/object/crenelBeanSprout.c @@ -140,7 +140,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) { if (super->parent->action == 2) { switch (super->parent->subAction) { case 1: - if ((gPlayerState.field_0xd & 0x80) != 0) { + if ((gPlayerState.direction & 0x80) != 0) { InitializeAnimation(super, 4); } else { GetNextFrame(super); @@ -163,7 +163,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) { } else { gPlayerState.mobility |= 0x80; gPlayerState.heldObject = 5; - if ((gPlayerState.field_0xd & 0x80) != 0) { + if ((gPlayerState.direction & 0x80) != 0) { InitializeAnimation(super, (super->type >> 1) + 3); } else { GetNextFrame(super); @@ -181,7 +181,7 @@ void CrenelBeanSprout_Action1(CrenelBeanSproutEntity* this) { RestorePrevTileEntity(0xdc, super->collisionLayer); sub_08096A78(this); } - if ((gPlayerState.playerInput.field_0x92 & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) { + if ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_40)) == 0) { return; } if (gUnk_0200AF00.unk_2f != 3) { @@ -297,7 +297,7 @@ void CrenelBeanSprout_Action6SubAction1(CrenelBeanSproutEntity* this) { sub_0807B7D8(gUnk_081231AE[super->type2], COORD_TO_TILE(super), super->collisionLayer); super->type2++; if (super->type2 == super->subtimer) { - gPlayerState.keepFacing &= 0x7f; + gPlayerState.keepFacing &= ~0x80; super->subAction++; super->timer = 60; } else { diff --git a/src/object/fileScreenObjects.c b/src/object/fileScreenObjects.c index 868902b1..43dde1a2 100644 --- a/src/object/fileScreenObjects.c +++ b/src/object/fileScreenObjects.c @@ -9,8 +9,8 @@ #include "main.h" #include "menu.h" #include "object.h" +#include "player.h" -extern int sub_0807A094(int); extern u32 sub_080041EC(int, int); static bool32 sub_0808E950(void); @@ -104,7 +104,7 @@ void sub_0808E818(Entity* this) { this->field_0x68.HWORD = CheckGlobalFlag(EZERO_1ST) == 0 ? 0x400 : 0x100; this->field_0x70.BYTES.byte0 = 4; this->animationState = 2; - var1 = gUnk_08133368[sub_0807A094(1) - 22] & 0xFFFFFF; + var1 = gUnk_08133368[GetPlayerPalette(TRUE) - 22] & 0xFFFFFF; LoadPalettes(&gGlobalGfxAndPalettes[var1], 31, 1); } diff --git a/src/object/frozenOctorok.c b/src/object/frozenOctorok.c index 5415125e..85fbb2c0 100644 --- a/src/object/frozenOctorok.c +++ b/src/object/frozenOctorok.c @@ -319,7 +319,7 @@ void FrozenOctorok_Action1SubAction6(FrozenOctorokEntity* this) { super->subAction = 7; } if ((gRoomTransition.frameCount & 0xf) == 0) { - SoundReq(SFX_163); + SoundReq(SFX_TOGGLE_DIVING); } } diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index 225147a7..332a3ab4 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -179,7 +179,7 @@ void sub_0808692C(Entity* this) { static u8 sub_08086954(Entity* this) { if (sub_0800445C(this)) { if (GetAnimationStateInRectRadius(this, 6, 20) >= 0 && gPlayerEntity.animationState == 0 && - (u16)gPlayerState.playerInput.field_0x90 == PLAYER_INPUT_UP && gPlayerState.jump_status == 0) { + (u16)gPlayerState.playerInput.heldInput == PLAYER_INPUT_UP && gPlayerState.jump_status == 0) { this->timer--; } } else { diff --git a/src/object/houseDoorInterior.c b/src/object/houseDoorInterior.c index c8cc5334..50e8a7ba 100644 --- a/src/object/houseDoorInterior.c +++ b/src/object/houseDoorInterior.c @@ -92,7 +92,7 @@ void HouseDoorInterior_Action1(HouseDoorInteriorEntity* this) { if (sub_0800445C(super) && this->unk7d == 0) { ptr = gUnk_081227CC + super->type2; if (GetAnimationStateInRectRadius(super, ptr->x, ptr->y) >= 0 && - ptr->animationState == gPlayerEntity.animationState && gPlayerState.playerInput.field_0x90 & ptr->unk2) { + ptr->animationState == gPlayerEntity.animationState && gPlayerState.playerInput.heldInput & ptr->unk2) { --super->timer; } } else { diff --git a/src/object/itemForSale.c b/src/object/itemForSale.c index 283969f8..e4629fa1 100644 --- a/src/object/itemForSale.c +++ b/src/object/itemForSale.c @@ -99,7 +99,7 @@ void ItemForSale_Action1(ItemForSaleEntity* this) { super->interactType = 0; super->subAction = 1; sub_08078B48(); - ResetPlayerItem(); + ResetActiveItems(); gPlayerState.heldObject = 4; gNewPlayerEntity.unk_74 = super; gUnk_0200AF00.unk_2f = 2; @@ -119,9 +119,9 @@ void ItemForSale_Action2(ItemForSaleEntity* this) { } else { ptr = sub_080784E4(); if (((*(int*)(ptr + 8) == 0) || - ((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.unk_2f = 7, (gPlayerState.playerInput.field_0x92 & + ((*(u8*)(ptr + 1) != 1 || (gUnk_0200AF00.unk_2f = 7, (gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_8)) == 0)))) && - ((gPlayerState.playerInput.field_0x92 & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) { + ((gPlayerState.playerInput.newInput & (PLAYER_INPUT_80 | PLAYER_INPUT_10 | PLAYER_INPUT_8)) != 0)) { sub_080819B4(this); } } diff --git a/src/object/lampParticle.c b/src/object/lampParticle.c index 38f1ed64..85c73532 100644 --- a/src/object/lampParticle.c +++ b/src/object/lampParticle.c @@ -28,7 +28,7 @@ void LampParticle_Init(Entity* this) { } void LampParticle_Action1(Entity* this) { - if (1 < IsItemEquipped(ITEM_LANTERN_ON)) { + if (IsItemEquipped(ITEM_LANTERN_ON) >= EQUIP_SLOT_NONE) { DeleteThisEntity(); } GetNextFrame(this); diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index e03dd38f..88cf601a 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -570,7 +570,7 @@ void sub_08085E74(LilypadLargeEntity* this) { if (gPlayerState.item != NULL) { DeleteEntity(gPlayerState.item); } - ResetPlayerItem(); + ResetActiveItems(); } void sub_08085EFC(LilypadLargeEntity* this) { diff --git a/src/object/macroPlayer.c b/src/object/macroPlayer.c index 79921a39..075d749e 100644 --- a/src/object/macroPlayer.c +++ b/src/object/macroPlayer.c @@ -10,6 +10,7 @@ #include "functions.h" #include "object.h" #include "physics.h" +#include "player.h" typedef struct { Entity base; @@ -17,8 +18,6 @@ typedef struct { u16 unk6a; } MacroPlayerEntity; -extern int sub_0807A094(int); - void MacroPlayer_Type0(MacroPlayerEntity*); void MacroPlayer_Type1(MacroPlayerEntity*); void MacroPlayer_Type0_Init(MacroPlayerEntity*); @@ -118,7 +117,7 @@ void MacroPlayer_Type0_Init(MacroPlayerEntity* this) { super->spriteRendering.b0 = 3; SetAffineInfo(super, 4, 4, 0); gUnk_02018EB0.unk_14 = super; - ChangeObjPalette(super, sub_0807A094(0)); + ChangeObjPalette(super, GetPlayerPalette(FALSE)); pEVar1 = CreateObject(PORTAL_FALLING_PLAYER, 1, 0); if (pEVar1 != NULL) { pEVar1->parent = super; diff --git a/src/object/minecart.c b/src/object/minecart.c index bb839de4..eba55180 100644 --- a/src/object/minecart.c +++ b/src/object/minecart.c @@ -12,7 +12,7 @@ typedef struct { Entity base; u8 filler[0x1C]; - struct_030010EC* minecartData; + MinecartData* minecartData; } MinecartEntity; extern void sub_08017744(Entity*); @@ -39,7 +39,7 @@ void Minecart(Entity* this) { } void Minecart_Init(MinecartEntity* this) { - struct_030010EC* unk = &gRoomTransition.minecart_data[super->timer]; + MinecartData* unk = &gRoomTransition.minecart_data[super->timer]; this->minecartData = unk; if ((gRoomControls.room != unk->room) || (gPlayerState.flags & PL_IN_MINECART) != 0) { @@ -88,7 +88,7 @@ void Minecart_Action1(MinecartEntity* this) { gPlayerEntity.zVelocity = Q_16_16(2.0); gPlayerEntity.speed = 0x100; gPlayerEntity.flags &= ~PL_MINISH; - ResetPlayerItem(); + ResetActiveItems(); DeleteClones(); SoundReq(SFX_PLY_JUMP); } @@ -279,7 +279,7 @@ void Minecart_Action5(MinecartEntity* this) { } void Minecart_Action6(MinecartEntity* this) { - struct_030010EC* minecartData; + MinecartData* minecartData; if (gPlayerState.jump_status == 0) { super->action = 1; diff --git a/src/object/minishSizedEntrance.c b/src/object/minishSizedEntrance.c index f8904c9c..c12192c2 100644 --- a/src/object/minishSizedEntrance.c +++ b/src/object/minishSizedEntrance.c @@ -46,7 +46,7 @@ void MinishSizedEntrance_Action1(Entity* this) { } } if ((gPlayerState.flags & PL_MINISH) && EntityInRectRadius(this, &gPlayerEntity, 4, 4) && - (gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.playerInput.field_0x90) & gUnk_0812225C[this->type2])) { + (gPlayerEntity.z.HALF.HI == 0) && (((u16)gPlayerState.playerInput.heldInput) & gUnk_0812225C[this->type2])) { DoExitTransition(GetCurrentRoomProperty(this->timer)); } } diff --git a/src/object/octorokBossObject.c b/src/object/octorokBossObject.c index ad3afd84..eb1a2f1e 100644 --- a/src/object/octorokBossObject.c +++ b/src/object/octorokBossObject.c @@ -166,7 +166,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", this->child->parent = this->parent; GET_HELPER(this->child) = GET_HELPER(this); } - this->type2 += 1; + this->type2++; } CopyPosition(GET_HELPER(this)->tailObjects[0], this); return; @@ -193,7 +193,7 @@ NONMATCH("asm/non_matching/octorokBossObject/OctorokBossObject_Action1.inc", this->parent->subAction = 0; return; } - this->timer += 1; + this->timer++; return; case 2: if (this->parent->type2 == 3) { diff --git a/src/object/playerClone.c b/src/object/playerClone.c index 3dd8b990..e898dcfe 100644 --- a/src/object/playerClone.c +++ b/src/object/playerClone.c @@ -169,7 +169,7 @@ void sub_08084B1C(PlayerCloneEntity* this) { super->collisionFlags = gPlayerEntity.collisionFlags; super->hurtType = gPlayerEntity.hurtType; CopyPosition(super, super->child); - if (gPlayerState.field_0x3[1] != 0) { + if (gPlayerState.attack_status != 0) { super->child->damage = gPlayerState.item->damage; super->child->frameIndex = gPlayerState.item->frameIndex; super->child->spriteSettings.flipX = gPlayerState.item->spriteSettings.flipX; diff --git a/src/object/pot.c b/src/object/pot.c index 6c62da39..0e024f6f 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -121,7 +121,7 @@ void Pot_Action1(Entity* this) { if (GetTileUnderEntity(this) == 13) { CreateFx(this, FX_FALL_DOWN, 0); } else if (tileType == 0x4005) { - gPlayerState.field_0xab = 4; + gPlayerState.lastSwordMove = SWORD_MOVE_BREAK_POT; SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); } sub_08082850(this, NULL); diff --git a/src/object/pullableMushroom.c b/src/object/pullableMushroom.c index c03f3444..22982728 100644 --- a/src/object/pullableMushroom.c +++ b/src/object/pullableMushroom.c @@ -222,7 +222,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) { u32 uVar1; if (super->timer != 0) { uVar1 = sub_0808B1F0(this, super->child); - if ((gPlayerState.playerInput.field_0x90 & gUnk_081211E4[super->animationState]) != 0) { + if ((gPlayerState.playerInput.heldInput & gUnk_081211E4[super->animationState]) != 0) { GetNextFrame(super); if (uVar1 < 0x40) { sub_080044AE(&gPlayerEntity, 0x40, super->direction); @@ -247,7 +247,7 @@ void sub_0808AEB0(PullableMushroomEntity* this) { this->unk_7c = 1; super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); super->direction = (super->animationState << 3); - super->flags &= 0x7f; + super->flags &= ~0x80; super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX; InitializeAnimation(super, super->animationState + 5); if (sub_0808B21C(this, 0)) { @@ -291,7 +291,7 @@ void sub_0808B05C(PullableMushroomEntity* this) { super->animationState = AnimationStateFlip90(gPlayerEntity.animationState >> 1); super->direction = super->animationState << 3; super->spriteSettings.flipX = gPlayerEntity.spriteSettings.flipX; - super->flags &= 0x7f; + super->flags &= ~0x80; InitializeAnimation(super, super->animationState + 5); if (sub_0808B21C(this, 1)) { sub_0808B168((PullableMushroomEntity*)super->child, 1); diff --git a/src/object/pushableRock.c b/src/object/pushableRock.c index 56b2e10c..29b3fdd8 100644 --- a/src/object/pushableRock.c +++ b/src/object/pushableRock.c @@ -32,7 +32,7 @@ void PushableRock(PushableRockEntity* this) { void PushableRock_Init(PushableRockEntity* this) { super->spriteSettings.draw = 1; - super->action += 1; + super->action++; super->spriteRendering.b3 = 2; super->spritePriority.b0 = 4; super->spritePriority.b1 = 3; diff --git a/src/object/smallIceBlock.c b/src/object/smallIceBlock.c index 54a5bd7e..edd3aac5 100644 --- a/src/object/smallIceBlock.c +++ b/src/object/smallIceBlock.c @@ -148,7 +148,7 @@ void SmallIceBlock_Action3(SmallIceBlockEntity* this) { } super->action = 4; super->timer = 60; - super->flags &= 0x7f; + super->flags &= ~0x80; } void SmallIceBlock_Action4(SmallIceBlockEntity* this) { diff --git a/src/object/smokeParticle.c b/src/object/smokeParticle.c index 8cca7eff..de97206b 100644 --- a/src/object/smokeParticle.c +++ b/src/object/smokeParticle.c @@ -53,7 +53,7 @@ void SmokeParticle_Action1(Entity* this) { if (this->frame < 5) { this->hitbox = (Hitbox*)gUnk_08120A54[this->frame]; } else { - this->flags &= 0x7f; + this->flags &= ~0x80; } } } diff --git a/src/object/swordParticle.c b/src/object/swordParticle.c index fbdb0e52..3e197a29 100644 --- a/src/object/swordParticle.c +++ b/src/object/swordParticle.c @@ -70,7 +70,7 @@ void SwordParticle_Action1(SwordParticleEntity* this) { u32 tmp2; if (super->type2 != 0) { - if ((gPlayerState.field_0x1f[2] == 0) || ((gPlayerState.field_0x3[1] & 0x80) != 0)) { + if ((gPlayerState.field_0x1f[2] == 0) || ((gPlayerState.attack_status & 0x80) != 0)) { DeleteThisEntity(); } if (gPlayerState.field_0x1f[2] >= 0x50) { @@ -85,7 +85,7 @@ void SwordParticle_Action1(SwordParticleEntity* this) { DeleteThisEntity(); } } else { - if (gPlayerState.field_0x3[1] == 0) { + if (gPlayerState.attack_status == 0) { DeleteThisEntity(); } if ((gPlayerState.sword_state & 1) != 0) { diff --git a/src/object/thunderbold.c b/src/object/thunderbold.c index 6128b74d..3b3f7fa3 100644 --- a/src/object/thunderbold.c +++ b/src/object/thunderbold.c @@ -42,7 +42,7 @@ void Thunderbold(ThunderboldEntity* this) { void Thunderbold_Init(ThunderboldEntity* this) { const struct_08122950* ptr; super->action = 1; - super->flags &= 0x7f; + super->flags &= ~0x80; super->spriteSettings.draw = 1; if (super->collisionLayer == 0) { ResolveCollisionLayer(super); diff --git a/src/object/unusedSkull.c b/src/object/unusedSkull.c index 30c6ec1f..c6a2e1f5 100644 --- a/src/object/unusedSkull.c +++ b/src/object/unusedSkull.c @@ -53,7 +53,7 @@ void UnusedSkull_Init(UnusedSkullEntity* this) { void UnusedSkull_Action1(UnusedSkullEntity* this) { if (super->contactFlags == 0x9c) { super->action = 2; - super->flags &= 0x7f; + super->flags &= ~0x80; CreateFx(super, FX_ICE, 0); EnqueueSFX(SFX_10D); } |
