mirror of
https://github.com/zeldaret/tmc
synced 2026-08-20 22:24:01 -04:00
Document some player item stuff
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ void FrozenOctorok_Action1SubAction6(FrozenOctorokEntity* this) {
|
||||
super->subAction = 7;
|
||||
}
|
||||
if ((gRoomTransition.frameCount & 0xf) == 0) {
|
||||
SoundReq(SFX_163);
|
||||
SoundReq(SFX_TOGGLE_DIVING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -570,7 +570,7 @@ void sub_08085E74(LilypadLargeEntity* this) {
|
||||
if (gPlayerState.item != NULL) {
|
||||
DeleteEntity(gPlayerState.item);
|
||||
}
|
||||
ResetPlayerItem();
|
||||
ResetActiveItems();
|
||||
}
|
||||
|
||||
void sub_08085EFC(LilypadLargeEntity* this) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user