diff --git a/include/z64player.h b/include/z64player.h index 4d2d767766..25d04eb5a0 100644 --- a/include/z64player.h +++ b/include/z64player.h @@ -1284,7 +1284,7 @@ typedef struct Player { /* 0xB60 */ u16 blastMaskTimer; /* 0xB62 */ s16 unk_B62; /* 0xB64 */ u8 unk_B64; - /* 0xB65 */ u8 shockTimer; + /* 0xB65 */ u8 bodyShockTimer; /* 0xB66 */ u8 unk_B66; /* 0xB67 */ u8 remainingHopsCounter; // Deku hopping on water /* 0xB68 */ s16 fallStartHeight; // last truncated Y position before falling @@ -1312,8 +1312,8 @@ typedef struct Player { /* 0xBEC */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX]; /* 0xCC4 */ MtxF leftHandMf; /* 0xD04 */ MtxF shieldMf; - /* 0xD44 */ u8 isBurning; - /* 0xD45 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part + /* 0xD44 */ u8 bodyIsBurning; + /* 0xD45 */ u8 bodyFlameTimers[PLAYER_BODYPART_MAX]; // one flame per body part /* 0xD57 */ u8 unk_D57; /* 0xD58 */ AfterPutAwayFunc afterPutAwayFunc; // See `Player_SetupWaitForPutAway` and `Player_Action_WaitForPutAway` /* 0xD5C */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame) diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c index 72620ac951..0ed74b7614 100644 --- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c +++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c @@ -3448,10 +3448,10 @@ void Boss01_UpdateEffects(Boss01* this, PlayState* play) { if (player->invincibilityTimer == 0) { if ((temp2 < (KREG(49) + 210.0f)) && ((KREG(49) + 190.0f) < temp2)) { for (j = 0; j < PLAYER_BODYPART_MAX; j++) { - player->flameTimers[j] = Rand_S16Offset(0, 200); + player->bodyFlameTimers[j] = Rand_S16Offset(0, 200); } - player->isBurning = true; + player->bodyIsBurning = true; temp = Math_Atan2S_XY(diffZ, diffX); if ((KREG(49) + 100.0f) < temp2) { temp += 0x8000; diff --git a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c index 1e0fcbcba1..294843f9a1 100644 --- a/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c +++ b/src/overlays/actors/ovl_En_Encount3/z_en_encount3.c @@ -140,9 +140,9 @@ void EnEncount3_Update(Actor* thisx, PlayState* play2) { s16 i; for (i = 0; i < PLAYER_BODYPART_MAX; i++) { - player->flameTimers[i] = Rand_S16Offset(0, 200); + player->bodyFlameTimers[i] = Rand_S16Offset(0, 200); } - player->isBurning = true; + player->bodyIsBurning = true; sp3C = this->actor.world.pos.x - player->actor.world.pos.x; sp38 = this->actor.world.pos.z - player->actor.world.pos.z; diff --git a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c index 116c769481..cd06ecfdcb 100644 --- a/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c +++ b/src/overlays/actors/ovl_En_Water_Effect/z_en_water_effect.c @@ -476,12 +476,12 @@ void func_80A59C04(Actor* thisx, PlayState* play2) { (fabsf(ptr->unk_04.z - player->actor.world.pos.z) < 20.0f) && (fabsf(ptr->unk_04.y - (player->actor.world.pos.y + 25.0f)) < 30.0f)) { phi_s5 = true; - if ((player->transformation != PLAYER_FORM_GORON) && !player->isBurning) { + if ((player->transformation != PLAYER_FORM_GORON) && !player->bodyIsBurning) { func_800B8D50(play, &this->actor, 2.0f, Rand_ZeroFloat(0x10000), 0.0f, 0x10); - for (j = 0; j < ARRAY_COUNT(player->flameTimers); j++) { - player->flameTimers[j] = Rand_S16Offset(0, 200); + for (j = 0; j < ARRAY_COUNT(player->bodyFlameTimers); j++) { + player->bodyFlameTimers[j] = Rand_S16Offset(0, 200); } - player->isBurning = true; + player->bodyIsBurning = true; Player_PlaySfx(player, player->ageProperties->voiceSfxIdOffset + NA_SE_VO_LI_DEMO_DAMAGE); } } diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 0e69836493..f81e6ef0e6 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -5717,7 +5717,7 @@ void func_80834140(PlayState* play, Player* this, PlayerAnimationHeader* anim) { } } -s32 func_808341F4(PlayState* play, Player* this) { +s32 Player_UpdateBodyBurn(PlayState* play, Player* this) { f32 temp_fv0; f32 flameScale; f32 flameIntensity; @@ -5726,7 +5726,7 @@ s32 func_808341F4(PlayState* play, Player* this) { s32 spawnedFlame = false; s32 var_v0; s32 var_v1; - u8* timerPtr = this->flameTimers; + u8* timerPtr = this->bodyFlameTimers; if ((this->transformation == PLAYER_FORM_ZORA) || (this->transformation == PLAYER_FORM_DEKU)) { timerStep = 0; @@ -5778,7 +5778,7 @@ s32 func_808341F4(PlayState* play, Player* this) { Player_InflictDamage(play, -1); } } else { - this->isBurning = false; + this->bodyIsBurning = false; } return this->stateFlags1 & PLAYER_STATE1_80; @@ -5787,13 +5787,13 @@ s32 func_808341F4(PlayState* play, Player* this) { s32 func_808344C0(PlayState* play, Player* this) { s32 i = 0; - while (i < ARRAY_COUNT(this->flameTimers)) { - this->flameTimers[i] = Rand_S16Offset(0, 200); + while (i < ARRAY_COUNT(this->bodyFlameTimers)) { + this->bodyFlameTimers[i] = Rand_S16Offset(0, 200); i++; } - this->isBurning = true; - return func_808341F4(play, this); + this->bodyIsBurning = true; + return Player_UpdateBodyBurn(play, this); } s32 func_80834534(PlayState* play, Player* this) { @@ -5852,7 +5852,7 @@ s32 func_80834600(Player* this, PlayState* play) { if (!func_8083456C(play, this)) { if (this->unk_B75 == 4) { - this->shockTimer = 40; + this->bodyShockTimer = 40; } this->actor.colChkInfo.damage += this->unk_B74; @@ -5908,7 +5908,7 @@ s32 func_80834600(Player* this, PlayState* play) { var_a2_2 = 4; } else if (this->actor.colChkInfo.acHitEffect == 7) { var_a2_2 = 1; - this->shockTimer = 40; + this->bodyShockTimer = 40; } else if (this->actor.colChkInfo.acHitEffect == 9) { var_a2_2 = 1; if (func_80834534(play, this)) { @@ -9056,7 +9056,7 @@ s32 Player_ActionChange_3(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_800000; this->actor.bgCheckFlags &= ~BGCHECKFLAG_WATER; - this->isBurning = false; + this->bodyIsBurning = false; if (this->transformation == PLAYER_FORM_FIERCE_DEITY) { entry = D_8085D224[0]; @@ -11743,9 +11743,9 @@ void func_808442D8(PlayState* play, Player* this) { } } -void func_808445C4(PlayState* play, Player* this) { - this->shockTimer--; - this->unk_B66 += this->shockTimer; +void Player_UpdateBodyShock(PlayState* play, Player* this) { + this->bodyShockTimer--; + this->unk_B66 += this->bodyShockTimer; if (this->unk_B66 > 20) { Vec3f pos; Vec3f* bodyPartsPos; @@ -11753,7 +11753,7 @@ void func_808445C4(PlayState* play, Player* this) { s32 randIndex; this->unk_B66 -= 20; - scale = this->shockTimer * 2; + scale = this->bodyShockTimer * 2; if (scale > 40) { scale = 40; } @@ -12122,11 +12122,12 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { } } - if (this->shockTimer != 0) { - func_808445C4(play, this); + if (this->bodyShockTimer != 0) { + Player_UpdateBodyShock(play, this); } - if (this->isBurning) { - func_808341F4(play, this); + + if (this->bodyIsBurning) { + Player_UpdateBodyBurn(play, this); } if (this->stateFlags2 & PLAYER_STATE2_8000) { @@ -12252,8 +12253,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { func_80831F34(play, this, func_801242B4(this) ? &gPlayerAnim_link_swimer_swim_down - : ((this->shockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end - : &gPlayerAnim_link_derth_rebirth)); + : ((this->bodyShockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end + : &gPlayerAnim_link_derth_rebirth)); } } else { if ((this->actor.parent == NULL) && @@ -17877,7 +17878,7 @@ void Player_Action_83(Player* this, PlayState* play) { } } - this->shockTimer = 40; + this->bodyShockTimer = 40; Actor_PlaySfx_Flagged2(&this->actor, this->ageProperties->voiceSfxIdOffset + (NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG)); } diff --git a/tools/disasm/functions.txt b/tools/disasm/functions.txt index 06d579ce27..7b80b2fe2c 100644 --- a/tools/disasm/functions.txt +++ b/tools/disasm/functions.txt @@ -4403,7 +4403,7 @@ 0x808340D4:("func_808340D4",), 0x80834104:("func_80834104",), 0x80834140:("func_80834140",), - 0x808341F4:("func_808341F4",), + 0x808341F4:("Player_UpdateBodyBurn",), 0x808344C0:("func_808344C0",), 0x80834534:("func_80834534",), 0x8083456C:("func_8083456C",), @@ -4610,7 +4610,7 @@ 0x80843178:("Player_ProcessSceneCollision",), 0x80843EC0:("Player_UpdateCamAndSeqModes",), 0x808442D8:("func_808442D8",), - 0x808445C4:("func_808445C4",), + 0x808445C4:("Player_UpdateBodyShock",), 0x808446F4:("Player_DetectSecrets",), 0x80844784:("func_80844784",), 0x80844D80:("func_80844D80",),