Player Docs: Body Shock and Body Burn (#1712)

* oot docs

* spacing
This commit is contained in:
engineer124 2024-10-16 12:42:20 +11:00 committed by GitHub
parent 5587769b14
commit 4a3f9b0f6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 35 additions and 34 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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));
}

View File

@ -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",),