1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-26 22:56:20 +00:00

name shock and burn functions (#1594)

This commit is contained in:
fig02 2023-12-15 08:53:51 -05:00 committed by GitHub
parent e3316c9fb1
commit 2b5b0fac06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 37 deletions

View file

@ -822,7 +822,7 @@ typedef struct Player {
/* 0x088E */ u8 unk_88E; /* 0x088E */ u8 unk_88E;
/* 0x088F */ u8 unk_88F; /* 0x088F */ u8 unk_88F;
/* 0x0890 */ u8 unk_890; /* 0x0890 */ u8 unk_890;
/* 0x0891 */ u8 shockTimer; /* 0x0891 */ u8 bodyShockTimer;
/* 0x0892 */ u8 unk_892; /* 0x0892 */ u8 unk_892;
/* 0x0893 */ u8 hoverBootsTimer; /* 0x0893 */ u8 hoverBootsTimer;
/* 0x0894 */ s16 fallStartHeight; // last truncated Y position before falling /* 0x0894 */ s16 fallStartHeight; // last truncated Y position before falling
@ -842,8 +842,8 @@ typedef struct Player {
/* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX]; /* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX];
/* 0x09E0 */ MtxF mf_9E0; /* 0x09E0 */ MtxF mf_9E0;
/* 0x0A20 */ MtxF shieldMf; /* 0x0A20 */ MtxF shieldMf;
/* 0x0A60 */ u8 isBurning; /* 0x0A60 */ u8 bodyIsBurning;
/* 0x0A61 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part /* 0x0A61 */ u8 bodyFlameTimers[PLAYER_BODYPART_MAX]; // one flame per body part
/* 0x0A73 */ u8 unk_A73; /* 0x0A73 */ u8 unk_A73;
/* 0x0A74 */ PlayerFuncA74 func_A74; /* 0x0A74 */ PlayerFuncA74 func_A74;
/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame) /* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame)

View file

@ -1476,11 +1476,11 @@ void BossFd_UpdateEffects(BossFd* this, PlayState* play) {
if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) { if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) {
this->timers[3] = 50; this->timers[3] = 50;
func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30); func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
if (!player->isBurning) { if (!player->bodyIsBurning) {
for (i2 = 0; i2 < PLAYER_BODYPART_MAX; i2++) { for (i2 = 0; i2 < PLAYER_BODYPART_MAX; i2++) {
player->flameTimers[i2] = Rand_S16Offset(0, 200); player->bodyFlameTimers[i2] = Rand_S16Offset(0, 200);
} }
player->isBurning = true; player->bodyIsBurning = true;
} }
} }
if (effect->timer2 == 0) { if (effect->timer2 == 0) {

View file

@ -1868,10 +1868,10 @@ void func_80902348(BossGanon2* this, PlayState* play) {
if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 784.0f) { if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 784.0f) {
for (j = 0; j < PLAYER_BODYPART_MAX; j++) { 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;
func_8002F6D4(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10); func_8002F6D4(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10);
sZelda->unk_3C8 = 8; sZelda->unk_3C8 = 8;
} }

View file

@ -811,12 +811,12 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, PlayState* play) {
if (sFreezeState == 0) { if (sFreezeState == 0) {
sFreezeState = 1; sFreezeState = 1;
} }
} else if (!player->isBurning) { } else if (!player->bodyIsBurning) {
for (i = 0; i < PLAYER_BODYPART_MAX; 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;
Player_PlaySfx(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE); Player_PlaySfx(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE);
} }
} }
@ -3172,7 +3172,7 @@ void BossTw_TwinrovaUpdate(Actor* thisx, PlayState* play2) {
} }
} }
if (player->isBurning && sShieldIceCharge != 0) { if (player->bodyIsBurning && sShieldIceCharge != 0) {
sShieldIceCharge = 4; sShieldIceCharge = 4;
} }
} }
@ -4055,15 +4055,15 @@ void BossTw_BlastFire(BossTw* this, PlayState* play) {
yDiff = sKoumePtr->groundBlastPos2.y - player->actor.world.pos.y; yDiff = sKoumePtr->groundBlastPos2.y - player->actor.world.pos.y;
zDiff = sKoumePtr->groundBlastPos2.z - player->actor.world.pos.z; zDiff = sKoumePtr->groundBlastPos2.z - player->actor.world.pos.z;
if (!player->isBurning && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) && (fabsf(yDiff) < 10.0f) && if (!player->bodyIsBurning && (player->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
(sqrtf(SQ(xDiff) + SQ(zDiff)) < (sKoumePtr->workf[UNK_F13] * 4550.0f))) { (fabsf(yDiff) < 10.0f) && (sqrtf(SQ(xDiff) + SQ(zDiff)) < (sKoumePtr->workf[UNK_F13] * 4550.0f))) {
s16 j; s16 j;
for (j = 0; j < 18; j++) { for (j = 0; j < 18; j++) {
player->flameTimers[j] = Rand_S16Offset(0, 200); player->bodyFlameTimers[j] = Rand_S16Offset(0, 200);
} }
player->isBurning = 1; player->bodyIsBurning = true;
if (this->work[BURN_TMR] == 0) { if (this->work[BURN_TMR] == 0) {
Player_PlaySfx(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE); Player_PlaySfx(player, player->ageProperties->unk_92 + NA_SE_VO_LI_DEMO_DAMAGE);

View file

@ -163,13 +163,13 @@ void func_809BC598(EnBdfire* this, PlayState* play) {
Actor_Kill(&this->actor); Actor_Kill(&this->actor);
return; return;
} }
} else if (!player->isBurning) { } else if (!player->bodyIsBurning) {
distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f; distToBurn = (this->actor.scale.x * 130.0f) / 4.2000003f;
if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) { if (this->actor.xyzDistToPlayerSq < SQ(distToBurn)) {
for (i = 0; i < 18; i++) { for (i = 0; i < 18; i++) {
player->flameTimers[i] = Rand_S16Offset(0, 200); player->bodyFlameTimers[i] = Rand_S16Offset(0, 200);
} }
player->isBurning = true; player->bodyIsBurning = true;
func_8002F6D4(play, &this->actor, 20.0f, this->actor.world.rot.y, 0.0f, 8); func_8002F6D4(play, &this->actor, 20.0f, this->actor.world.rot.y, 0.0f, 8);
osSyncPrintf("POWER\n"); osSyncPrintf("POWER\n");
} }

View file

@ -4277,10 +4277,10 @@ void func_8083821C(Player* this) {
s32 i; s32 i;
// clang-format off // clang-format off
for (i = 0; i < PLAYER_BODYPART_MAX; i++) { this->flameTimers[i] = Rand_S16Offset(0, 200); } for (i = 0; i < PLAYER_BODYPART_MAX; i++) { this->bodyFlameTimers[i] = Rand_S16Offset(0, 200); }
// clang-format on // clang-format on
this->isBurning = true; this->bodyIsBurning = true;
} }
void func_80838280(Player* this) { void func_80838280(Player* this) {
@ -4348,7 +4348,7 @@ s32 func_808382DC(Player* this, PlayState* play) {
func_80838280(this); func_80838280(this);
if (this->unk_8A1 == 3) { if (this->unk_8A1 == 3) {
this->shockTimer = 40; this->bodyShockTimer = 40;
} }
this->actor.colChkInfo.damage += this->unk_8A0; this->actor.colChkInfo.damage += this->unk_8A0;
@ -10709,16 +10709,16 @@ void func_80848A04(PlayState* play, Player* this) {
temp * 200.0f, 0, 8); temp * 200.0f, 0, 8);
} }
void func_80848B44(PlayState* play, Player* this) { void Player_UpdateBodyShock(PlayState* play, Player* this) {
Vec3f shockPos; Vec3f shockPos;
Vec3f* randBodyPart; Vec3f* randBodyPart;
s32 shockScale; s32 shockScale;
this->shockTimer--; this->bodyShockTimer--;
this->unk_892 += this->shockTimer; this->unk_892 += this->bodyShockTimer;
if (this->unk_892 > 20) { if (this->unk_892 > 20) {
shockScale = this->shockTimer * 2; shockScale = this->bodyShockTimer * 2;
this->unk_892 -= 20; this->unk_892 -= 20;
if (shockScale > 40) { if (shockScale > 40) {
@ -10735,7 +10735,7 @@ void func_80848B44(PlayState* play, Player* this) {
} }
} }
void func_80848C74(PlayState* play, Player* this) { void Player_UpdateBodyBurn(PlayState* play, Player* this) {
s32 spawnedFlame; s32 spawnedFlame;
u8* timerPtr; u8* timerPtr;
s32 timerStep; s32 timerStep;
@ -10753,7 +10753,7 @@ void func_80848C74(PlayState* play, Player* this) {
} }
spawnedFlame = false; spawnedFlame = false;
timerPtr = this->flameTimers; timerPtr = this->bodyFlameTimers;
if (this->stateFlags2 & PLAYER_STATE2_3) { if (this->stateFlags2 & PLAYER_STATE2_3) {
sp58 = 100; sp58 = 100;
@ -10798,7 +10798,7 @@ void func_80848C74(PlayState* play, Player* this) {
Player_InflictDamage(play, -1); Player_InflictDamage(play, -1);
} }
} else { } else {
this->isBurning = false; this->bodyIsBurning = false;
} }
} }
@ -10958,12 +10958,12 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
this->unk_860++; this->unk_860++;
} }
if (this->shockTimer != 0) { if (this->bodyShockTimer != 0) {
func_80848B44(play, this); Player_UpdateBodyShock(play, this);
} }
if (this->isBurning) { if (this->bodyIsBurning) {
func_80848C74(play, this); Player_UpdateBodyBurn(play, this);
} }
if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) && if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) &&
@ -11148,7 +11148,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
} else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & PLAYER_STATE1_27)) { } else if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & PLAYER_STATE1_27)) {
func_80836448(play, this, func_80836448(play, this,
func_808332B8(this) ? &gPlayerAnim_link_swimer_swim_down func_808332B8(this) ? &gPlayerAnim_link_swimer_swim_down
: (this->shockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end : (this->bodyShockTimer != 0) ? &gPlayerAnim_link_normal_electric_shock_end
: &gPlayerAnim_link_derth_rebirth); : &gPlayerAnim_link_derth_rebirth);
} }
} else { } else {
@ -13629,7 +13629,7 @@ void Player_Action_8084FBF4(Player* this, PlayState* play) {
} }
} }
this->shockTimer = 40; this->bodyShockTimer = 40;
func_8002F8F0(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92); func_8002F8F0(&this->actor, NA_SE_VO_LI_TAKEN_AWAY - SFX_FLAG + this->ageProperties->unk_92);
} }