Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/overlays/actors/ovl_En_Box/z_en_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) {
this->iceSmokeTimer = 0;
this->unk_1FB = ENBOX_STATE_0;
this->dyna.actor.gravity = -5.5f;
this->giItem = this->dyna.actor.world.rot.x & 0xFF;
this->switchFlag = this->dyna.actor.world.rot.z;
this->dyna.actor.minVelocityY = -50.0f;

Expand Down Expand Up @@ -188,6 +189,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) {
}

this->dyna.actor.world.rot.y += 0x8000;
this->dyna.actor.home.rot.x = this->dyna.actor.world.rot.x = this->dyna.actor.shape.rot.x = 0;
this->dyna.actor.home.rot.z = this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;

//! @bug Flex skeleton is used as normal skeleton
Expand Down Expand Up @@ -447,7 +449,9 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) {
Actor_WorldToActorCoords(&this->dyna.actor, &sp4C, &player->actor.world.pos);
if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f &&
Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) {
Actor_OfferGetItemNearby(&this->dyna.actor, play, -PARAMS_GET_U(this->dyna.actor.params, 5, 7));
if (this->giItem > 0)
Actor_OfferGetItemNearby(&this->dyna.actor, play, -this->giItem);
else Actor_OfferGetItemNearby(&this->dyna.actor, play, -PARAMS_GET_U(this->dyna.actor.params, 5, 7));
}
if (Flags_GetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5))) {
EnBox_SetupAction(this, EnBox_Open);
Expand Down Expand Up @@ -569,7 +573,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) {
void EnBox_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) {
EnBox* this = (EnBox*)thisx;
s32 pad;
u8 i = PARAMS_GET_U(this->dyna.actor.params, 5, 7);
u8 i = this->giItem > 0 ? this->giItem : PARAMS_GET_U(this->dyna.actor.params, 5, 7);
bool is_key = i == GI_SMALL_KEY;
bool is_dungeon_item = i == GI_COMPASS || i == GI_DUNGEON_MAP;
bool is_item = i == GI_BOW || i == GI_SLINGSHOT || i == GI_BOOMERANG || i == GI_HOOKSHOT || i == GI_LONGSHOT || i == GI_LENS_OF_TRUTH || i == GI_HAMMER || i == GI_BOTTLE_EMPTY || i == GI_SWORD_KOKIRI || i == GI_SWORD_HEROS || i == GI_SWORD_KNIFE || i == GI_SWORD_BIGGORON || i == GI_SHIELD_DEKU || i == GI_SHIELD_HYLIAN || i == GI_SHIELD_MIRROR || i == GI_SHIELD_HEROS || i == GI_BOOTS_IRON || i == GI_BOOTS_HOVER ||
Expand Down
3 changes: 2 additions & 1 deletion src/overlays/actors/ovl_En_Box/z_en_box.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ typedef struct EnBox {
/* 0x01F9 */ u8 type;
/* 0x01FA */ u8 iceSmokeTimer;
/* 0x01FB */ u8 unk_1FB;
} EnBox; // size = 0x01FC
/* 0x01FC */ u8 giItem;
} EnBox; // size = 0x01FD

#endif