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
2 changes: 1 addition & 1 deletion include/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ typedef struct ActorContextSceneFlags {
typedef struct ActorContext {
/* 0x000 */ u8 freezeFlashTimer;
/* 0x001 */ char unk_01[0x01];
/* 0x002 */ u8 unk_02;
/* 0x002 */ u8 hammerShockwaveTimer;
/* 0x003 */ u8 lensActive;
/* 0x004 */ char unk_04[0x04];
/* 0x008 */ u8 total; // total number of actors loaded
Expand Down
8 changes: 4 additions & 4 deletions include/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,13 +768,13 @@ typedef struct WeaponInfo {
#define PLAYER_STATE2_USING_OCARINA (1 << 27) // Playing the ocarina or warping out from an ocarina warp song
#define PLAYER_STATE2_IDLE_FIDGET (1 << 28) // Playing a fidget idle animation (under typical circumstances, see `Player_ChooseNextIdleAnim` for more info)
#define PLAYER_STATE2_29 (1 << 29)
#define PLAYER_STATE2_30 (1 << 30)
#define PLAYER_STATE2_ATTACK_MOVE_FORWARD (1 << 30) // Set when forward melee attack/releasing spin attack with stick forward, to move slightly forward during the attack
#define PLAYER_STATE2_31 (1 << 31)

#define PLAYER_STATE3_0 (1 << 0)
#define PLAYER_STATE3_1 (1 << 1)
#define PLAYER_STATE3_KNOCKBACK_JUMPSLASH (1 << 1) // Player is in the air and cannot control their actions due to being knocked back or doing a jumpslash
#define PLAYER_STATE3_2 (1 << 2)
#define PLAYER_STATE3_3 (1 << 3)
#define PLAYER_STATE3_MELEE_ATTACK (1 << 3) // Set after melee attacks, maintained shortly by hostile idle action to avoid adjusting yaw
#define PLAYER_STATE3_4 (1 << 4)
#define PLAYER_STATE3_5 (1 << 5)
#define PLAYER_STATE3_RESTORE_NAYRUS_LOVE (1 << 6) // Set by ocarina effects actors when destroyed to signal Nayru's Love may be restored (see `ACTOROVL_ALLOC_ABSOLUTE`)
Expand Down Expand Up @@ -906,7 +906,7 @@ typedef struct Player {
/* 0x0842 */ s8 meleeWeaponAnimation;
/* 0x0843 */ s8 meleeWeaponState;
/* 0x0844 */ s8 unk_844;
/* 0x0845 */ u8 unk_845;
/* 0x0845 */ u8 tripleSlashCount;
/* 0x0846 */ u8 controlStickDataIndex; // cycles between 0 - 3. Used to index `controlStickSpinAngles` and `controlStickDirections`
/* 0x0847 */ s8 controlStickSpinAngles[4]; // Stores a modified version of the control stick angle for the last 4 frames. Used for checking spins.
/* 0x084B */ s8 controlStickDirections[4]; // Stores the control stick direction (relative to shape yaw) for the last 4 frames. See `PlayerStickDirection`.
Expand Down
6 changes: 3 additions & 3 deletions src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2423,8 +2423,8 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
play->numActorEntries = 0;
}

if (actorCtx->unk_02 != 0) {
actorCtx->unk_02--;
if (actorCtx->hammerShockwaveTimer != 0) {
actorCtx->hammerShockwaveTimer--;
}

#if DEBUG_FEATURES
Expand Down Expand Up @@ -4648,7 +4648,7 @@ s32 func_80035124(Actor* actor, PlayState* play) {
u8 func_800353E8(PlayState* play) {
Player* player = GET_PLAYER(play);

return player->unk_845;
return player->tripleSlashCount;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/code/z_player_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,9 +1571,9 @@ void Player_DrawGetItem(PlayState* play, Player* this) {
void Player_CalcMeleeWeaponTipPositions(Player* this, Vec3f* tipPositions) {
sMeleeWeaponTipOffsetFromLeftHand1.x = sMeleeWeaponTipOffsetFromLeftHand0.x;

if (this->unk_845 >= 3) {
this->unk_845++;
sMeleeWeaponTipOffsetFromLeftHand1.x *= 1.0f + ((9 - this->unk_845) * 0.1f);
if (this->tripleSlashCount >= 3) {
this->tripleSlashCount++;
sMeleeWeaponTipOffsetFromLeftHand1.x *= 1.0f + ((9 - this->tripleSlashCount) * 0.1f);
}

sMeleeWeaponTipOffsetFromLeftHand1.x += 1200.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void BgGanonOtyuka_WaitToFall(BgGanonOtyuka* this, PlayState* play) {
f32 dz;
Vec3f center;

if (this->isFalling || ((play->actorCtx.unk_02 != 0) && (this->dyna.actor.xyzDistToPlayerSq < SQ(70.0f)))) {
if (this->isFalling || ((play->actorCtx.hammerShockwaveTimer != 0) && (this->dyna.actor.xyzDistToPlayerSq < SQ(70.0f)))) {
PRINTF("OTC O 1\n");

for (i = 0; i < ARRAY_COUNT(D_80876A68); i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Bw/z_en_bw.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ void func_809D0584(EnBw* this, PlayState* play) {
this->unk_248 = 0.0f;
}
}
if ((play->actorCtx.unk_02 != 0) && (this->actor.xzDistToPlayer <= 400.0f) &&
if ((play->actorCtx.hammerShockwaveTimer != 0) && (this->actor.xzDistToPlayer <= 400.0f) &&
(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->unk_220 == 5) {
this->unk_23C = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ void EnDekubaba_UpdateDamage(EnDekubaba* this, PlayState* play) {
} else {
return;
}
} else if ((play->actorCtx.unk_02 != 0) && (this->collider.base.colMaterial != COL_MATERIAL_HARD) &&
} else if ((play->actorCtx.hammerShockwaveTimer != 0) && (this->collider.base.colMaterial != COL_MATERIAL_HARD) &&
(this->actionFunc != EnDekubaba_StunnedVertical) && (this->actionFunc != EnDekubaba_Hit) &&
(this->actor.colChkInfo.health != 0)) {
this->actor.colChkInfo.health--;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void EnDekunuts_ColliderCheck(EnDekunuts* this, PlayState* play) {
} else {
EnDekunuts_SetupBeginRun(this);
}
} else if ((this->actor.colChkInfo.mass == MASS_IMMOVABLE) && (play->actorCtx.unk_02 != 0)) {
} else if ((this->actor.colChkInfo.mass == MASS_IMMOVABLE) && (play->actorCtx.hammerShockwaveTimer != 0)) {
EnDekunuts_SetupBeginRun(this);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/actors/ovl_En_Dh/z_en_dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ void EnDh_CollisionCheck(EnDh* this, PlayState* play) {
this->colliderJntSph.elements[0].base.atDmgInfo.dmgFlags =
this->colliderJntSph.elements[0].base.atDmgInfo.damage = 0;
if (player->unk_844 != 0) {
this->unk_258 = player->unk_845;
this->unk_258 = player->tripleSlashCount;
}
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8);
lastHealth = this->actor.colChkInfo.health;
Expand Down Expand Up @@ -555,7 +555,7 @@ void EnDh_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider1.base);
}
if (((this->curAction != DH_DAMAGE) && (this->actor.shape.yOffset == 0.0f)) ||
((player->unk_844 != 0) && (player->unk_845 != this->unk_258))) {
((player->unk_844 != 0) && (player->tripleSlashCount != this->unk_258))) {

CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderJntSph.base);
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Dh/z_en_dh.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ typedef struct EnDh {
/* 0x0251 */ u8 retreat;
/* 0x0252 */ u8 drawDirtWave;
/* 0x0254 */ EnDhActionFunc actionFunc;
/* 0x0258 */ u8 unk_258; // Related to player->unk_845
/* 0x0258 */ u8 unk_258; // Related to player->tripleSlashCount
/* 0x0259 */ u8 unused_259;
/* 0x025A */ u8 alpha;
/* 0x025B */ u8 curAction;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Dodojr/z_en_dodojr.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ s32 EnDodojr_CheckDamaged(EnDodojr* this, PlayState* play) {
return false;
}

if (play->actorCtx.unk_02 != 0) {
if (play->actorCtx.hammerShockwaveTimer != 0) {
if (this->actionFunc != EnDodojr_WaitUnderground) {
if (this->actionFunc == EnDodojr_EmergeFromGround) {
this->actor.shape.shadowDraw = ActorShadow_DrawCircle;
Expand Down
3 changes: 2 additions & 1 deletion src/overlays/actors/ovl_En_Fd/z_en_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@ s32 EnFd_CheckHammer(EnFd* this, PlayState* play) {
if (this->actionFunc == EnFd_Reappear || this->actionFunc == EnFd_SpinAndGrow ||
this->actionFunc == EnFd_JumpToGround || this->actionFunc == EnFd_WaitForCore) {
return false;
} else if (play->actorCtx.unk_02 != 0 && this->actor.xzDistToPlayer < 300.0f && this->actor.yDistToPlayer < 60.0f) {
} else if (play->actorCtx.hammerShockwaveTimer != 0 && this->actor.xzDistToPlayer < 300.0f &&
this->actor.yDistToPlayer < 60.0f) {
return true;
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void EnHintnuts_ColliderCheck(EnHintnuts* this, PlayState* play) {
EnHintnuts_HitByScrubProjectile1(this, play);
EnHintnuts_HitByScrubProjectile2(this);
}
} else if (play->actorCtx.unk_02 != 0) {
} else if (play->actorCtx.hammerShockwaveTimer != 0) {
EnHintnuts_HitByScrubProjectile1(this, play);
EnHintnuts_HitByScrubProjectile2(this);
}
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Kanban/z_en_kanban.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ void EnKanban_Update(Actor* thisx, PlayState* play2) {
}
EffectSsGRipple_Spawn(play, &this->actor.world.pos, rippleScale, rippleScale + 500, 0);
}
} else if ((play->actorCtx.unk_02 != 0) && (this->actor.xyzDistToPlayerSq < SQ(100.0f))) {
} else if ((play->actorCtx.hammerShockwaveTimer != 0) && (this->actor.xyzDistToPlayerSq < SQ(100.0f))) {
f32 hammerStrength = (100.0f - sqrtf(this->actor.xyzDistToPlayerSq)) * 0.05f;

this->actionState = ENKANBAN_AIR;
Expand Down
5 changes: 3 additions & 2 deletions src/overlays/actors/ovl_En_Rd/z_en_rd.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ void EnRd_UpdateDamage(EnRd* this, PlayState* play) {
if (this->action != REDEAD_ACTION_RISE_FROM_COFFIN) {
Actor_SetDropFlag(&this->actor, &this->collider.elem, true);
if (player->unk_844 != 0) {
this->unk_31D = player->unk_845;
this->unk_31D = player->tripleSlashCount;
}

if ((this->damageReaction != REDEAD_DMG_REACT_NONE) &&
Expand Down Expand Up @@ -916,7 +916,8 @@ void EnRd_Update(Actor* thisx, PlayState* play) {
if ((this->actor.colChkInfo.health > 0) && (this->action != REDEAD_ACTION_GRAB)) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
if ((this->action != REDEAD_ACTION_DAMAGED) || ((player->unk_844 != 0) && (player->unk_845 != this->unk_31D))) {
if ((this->action != REDEAD_ACTION_DAMAGED) ||
((player->unk_844 != 0) && (player->tripleSlashCount != this->unk_31D))) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Rd/z_en_rd.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef struct EnRd {
/* 0x031A */ u8 fireTimer;
/* 0x031B */ u8 action;
/* 0x031C */ u8 damageReaction;
/* 0x031D */ u8 unk_31D; // related to player->unk_845
/* 0x031D */ u8 unk_31D; // related to player->tripleSlashCount
/* 0x0320 */ ColliderCylinder collider;
} EnRd; // size = 0x036C

Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Shopnuts/z_en_shopnuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ void EnShopnuts_ColliderCheck(EnShopnuts* this, PlayState* play) {
this->collider.base.acFlags &= ~AC_HIT;
Actor_SetDropFlag(&this->actor, &this->collider.elem, true);
EnShopnuts_SetupSpawnSalesman(this);
} else if (play->actorCtx.unk_02 != 0) {
} else if (play->actorCtx.hammerShockwaveTimer != 0) {
EnShopnuts_SetupSpawnSalesman(this);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Ssh/z_en_ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ s32 EnSsh_CollisionCheck(EnSsh* this, PlayState* play) {
}
if (EnSsh_CheckHitFront(this)) {
return false;
} else if (play->actorCtx.unk_02 != 0) {
} else if (play->actorCtx.hammerShockwaveTimer != 0) {
this->invincibilityTimer = 8;
if (this->stunTimer == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_St/z_en_st.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ s32 EnSt_CheckColliders(EnSt* this, PlayState* play) {
return false;
}

if (play->actorCtx.unk_02 != 0) {
if (play->actorCtx.hammerShockwaveTimer != 0) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Sw/z_en_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) {
s32 phi_v1 = false;

if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET_S(this->actor.params, 13, 3) == 0 &&
play->actorCtx.unk_02 != 0) {
play->actorCtx.hammerShockwaveTimer != 0) {

this->actor.colChkInfo.damage = this->actor.colChkInfo.health;
phi_v1 = true;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_En_Test/z_en_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ void EnTest_UpdateDamage(EnTest* this, PlayState* play) {
if (this->swordState >= 1) {
this->swordState = 0;
}
this->unk_7DC = player->unk_845;
this->unk_7DC = player->tripleSlashCount;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
Actor_SetDropFlag(&this->actor, &this->bodyCollider.elem, false);
Audio_StopSfxByPosAndId(&this->actor.projectedPos, NA_SE_EN_STAL_WARAU);
Expand Down
4 changes: 2 additions & 2 deletions src/overlays/actors/ovl_En_Tite/z_en_tite.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,8 @@ void EnTite_CheckDamage(Actor* thisx, PlayState* play) {
}
}
// If hammer has recently hit the floor and player is close to tektite, flip over
} else if ((thisx->colChkInfo.health != 0) && (play->actorCtx.unk_02 != 0) && (thisx->xzDistToPlayer <= 400.0f) &&
(thisx->bgCheckFlags & BGCHECKFLAG_GROUND)) {
} else if ((thisx->colChkInfo.health != 0) && (play->actorCtx.hammerShockwaveTimer != 0) &&
(thisx->xzDistToPlayer <= 400.0f) && (thisx->bgCheckFlags & BGCHECKFLAG_GROUND)) {
if (this->flipState == TEKTITE_FLIPPED) {
EnTite_SetupFlipUpright(this);
} else if ((this->action >= TEKTITE_IDLE) || (this->action >= TEKTITE_IDLE)) {
Expand Down
Loading