1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Match retail z_en_ds.c, z_en_horse.c, z_en_fhg_fire.c (#1897)

* Actually match z_en_ds.c

* Match z_en_horse.c

* Match z_en_fhg_fire.c
This commit is contained in:
cadmic 2024-02-26 23:30:42 -08:00 committed by GitHub
parent c6e3ef4570
commit a32221c36e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 22 deletions

View file

@ -215,6 +215,8 @@ void EnDs_Wait(EnDs* this, PlayState* play) {
player->actor.textId = 0x500C; player->actor.textId = 0x500C;
this->actionFunc = EnDs_OfferBluePotion; this->actionFunc = EnDs_OfferBluePotion;
} else { } else {
s16 pad;
if (INV_CONTENT(ITEM_ODD_MUSHROOM) == ITEM_ODD_MUSHROOM) { if (INV_CONTENT(ITEM_ODD_MUSHROOM) == ITEM_ODD_MUSHROOM) {
player->actor.textId = 0x5049; player->actor.textId = 0x5049;
} else { } else {

View file

@ -283,7 +283,6 @@ void EnFhgFire_LightningTrail(EnFhgFire* this, PlayState* play) {
void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) { void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
Vec3f pos;
if (this->collider.base.atFlags & AT_HIT) { if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT; this->collider.base.atFlags &= ~AT_HIT;
@ -291,7 +290,8 @@ void EnFhgFire_LightningShock(EnFhgFire* this, PlayState* play) {
} }
if (Rand_ZeroOne() < 0.5f) { if (Rand_ZeroOne() < 0.5f) {
pos = this->actor.world.pos; Vec3f pos = this->actor.world.pos;
pos.y -= 20.0f; pos.y -= 20.0f;
EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR); EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, 200, FHGFLASH_SHOCK_NO_ACTOR);
} }
@ -447,7 +447,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
Actor_SetScale(&this->actor, 5.25f); Actor_SetScale(&this->actor, 5.25f);
} }
this->actor.shape.rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x4000; this->actor.shape.rot.z += (s16)(Rand_ZeroOne() * 0x4E20) + 0x4000;
{ if (1) {
u8 lightBallColor1 = FHGFLASH_LIGHTBALL_GREEN; u8 lightBallColor1 = FHGFLASH_LIGHTBALL_GREEN;
s16 i1; s16 i1;
Vec3f spD4; Vec3f spD4;
@ -527,7 +527,9 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
&gSfxDefaultReverb); &gSfxDefaultReverb);
Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100); Rumble_Request(this->actor.xyzDistToPlayerSq, 180, 20, 100);
} }
} else if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) { break;
}
if (sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f) {
killMode = BALL_BURST; killMode = BALL_BURST;
Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER); Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_HIT_THUNDER);
if ((bossGnd->flyMode >= GND_FLY_VOLLEY) && (this->work[FHGFIRE_RETURN_COUNT] >= 2)) { if ((bossGnd->flyMode >= GND_FLY_VOLLEY) && (this->work[FHGFIRE_RETURN_COUNT] >= 2)) {
@ -642,7 +644,6 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) { void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) {
EnfHG* horse = (EnfHG*)this->actor.parent; EnfHG* horse = (EnfHG*)this->actor.parent;
f32 scrollDirection;
this->fwork[FHGFIRE_WARP_TEX_1_X] += 25.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED]; this->fwork[FHGFIRE_WARP_TEX_1_X] += 25.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED];
this->fwork[FHGFIRE_WARP_TEX_1_Y] -= 40.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED]; this->fwork[FHGFIRE_WARP_TEX_1_Y] -= 40.0f * this->fwork[FHGFIRE_WARP_TEX_SPEED];
@ -662,7 +663,8 @@ void EnFhgFire_PhantomWarp(EnFhgFire* this, PlayState* play) {
} }
if (this->work[FHGFIRE_TIMER] > 50) { if (this->work[FHGFIRE_TIMER] > 50) {
scrollDirection = 1.0f; f32 scrollDirection = 1.0f;
if (this->actor.params > FHGFIRE_WARP_EMERGE) { if (this->actor.params > FHGFIRE_WARP_EMERGE) {
scrollDirection = -1.0f; scrollDirection = -1.0f;
} }

View file

@ -529,14 +529,13 @@ void EnHorse_RotateToPoint(EnHorse* this, PlayState* play, Vec3f* pos, s16 turnA
void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo) { void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo) {
Vec3f curWaypointPos; Vec3f curWaypointPos;
Vec3f prevWaypointPos; Vec3f prevWaypointPos;
f32 playerDist; s32 prevWaypoint;
f32 sp50; f32 sp50;
s16 relPlayerYaw; s16 relPlayerYaw;
f32 px; f32 px;
f32 pz; f32 pz;
f32 d; f32 d;
f32 distSq; f32 distSq;
s32 prevWaypoint;
EnHorse_RaceWaypointPos(raceInfo->waypoints, this->curRaceWaypoint, &curWaypointPos); EnHorse_RaceWaypointPos(raceInfo->waypoints, this->curRaceWaypoint, &curWaypointPos);
Math3D_RotateXZPlane(&curWaypointPos, raceInfo->waypoints[this->curRaceWaypoint].angle, &px, &pz, &d); Math3D_RotateXZPlane(&curWaypointPos, raceInfo->waypoints[this->curRaceWaypoint].angle, &px, &pz, &d);
@ -559,14 +558,15 @@ void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceIn
EnHorse_RotateToPoint(this, play, &curWaypointPos, 400); EnHorse_RotateToPoint(this, play, &curWaypointPos, 400);
if (distSq < SQ(300.0f)) { if (distSq < SQ(300.0f)) {
playerDist = this->actor.xzDistToPlayer; if (this->actor.xzDistToPlayer < 130.0f || this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) {
if (playerDist < 130.0f || this->jntSph.elements[0].base.ocElemFlags & OCELEM_HIT) { s32 pad;
if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) { if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) {
this->actor.world.rot.y -= 280; this->actor.world.rot.y -= 280;
} else { } else {
this->actor.world.rot.y += 280; this->actor.world.rot.y += 280;
} }
} else if (playerDist < 300.0f) { } else if (this->actor.xzDistToPlayer < 300.0f) {
if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) { if (Math_SinS(this->actor.yawTowardsPlayer - this->actor.world.rot.y) > 0.0f) {
this->actor.world.rot.y += 280; this->actor.world.rot.y += 280;
} else { } else {
@ -1320,8 +1320,7 @@ void EnHorse_MountedTrot(EnHorse* this, PlayState* play) {
} }
void EnHorse_StartGallopingInterruptable(EnHorse* this) { void EnHorse_StartGallopingInterruptable(EnHorse* this) {
this->noInputTimerMax = 0; this->noInputTimerMax = this->noInputTimer = 0;
this->noInputTimer = 0;
EnHorse_StartGalloping(this); EnHorse_StartGalloping(this);
} }
@ -1334,8 +1333,7 @@ void EnHorse_StartGalloping(EnHorse* this) {
} }
void EnHorse_MountedGallopReset(EnHorse* this) { void EnHorse_MountedGallopReset(EnHorse* this) {
this->noInputTimerMax = 0; this->noInputTimerMax = this->noInputTimer = 0;
this->noInputTimer = 0;
this->action = ENHORSE_ACT_MOUNTED_GALLOP; this->action = ENHORSE_ACT_MOUNTED_GALLOP;
this->animationIdx = ENHORSE_ANIM_GALLOP; this->animationIdx = ENHORSE_ANIM_GALLOP;
this->unk_234 = 0; this->unk_234 = 0;
@ -1498,8 +1496,7 @@ void EnHorse_Stopping(EnHorse* this, PlayState* play) {
} }
void EnHorse_StartReversingInterruptable(EnHorse* this) { void EnHorse_StartReversingInterruptable(EnHorse* this) {
this->noInputTimerMax = 0; this->noInputTimerMax = this->noInputTimer = 0;
this->noInputTimer = 0;
EnHorse_StartReversing(this); EnHorse_StartReversing(this);
} }
@ -1906,7 +1903,6 @@ void EnHorse_SetFollowAnimation(EnHorse* this, PlayState* play) {
void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) { void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) {
f32 distToPlayer; f32 distToPlayer;
f32 angleDiff;
R_EPONAS_SONG_PLAYED = false; R_EPONAS_SONG_PLAYED = false;
distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor); distToPlayer = Actor_WorldDistXZToActor(&this->actor, &GET_PLAYER(play)->actor);
@ -1914,6 +1910,8 @@ void EnHorse_FollowPlayer(EnHorse* this, PlayState* play) {
// First rotate if the player is behind // First rotate if the player is behind
if ((this->playerDir == PLAYER_DIR_BACK_R || this->playerDir == PLAYER_DIR_BACK_L) && if ((this->playerDir == PLAYER_DIR_BACK_R || this->playerDir == PLAYER_DIR_BACK_L) &&
(distToPlayer > 300.0f && !(this->stateFlags & ENHORSE_TURNING_TO_PLAYER))) { (distToPlayer > 300.0f && !(this->stateFlags & ENHORSE_TURNING_TO_PLAYER))) {
f32 angleDiff;
this->animationIdx = ENHORSE_ANIM_REARING; this->animationIdx = ENHORSE_ANIM_REARING;
this->stateFlags |= ENHORSE_TURNING_TO_PLAYER; this->stateFlags |= ENHORSE_TURNING_TO_PLAYER;
this->angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor); this->angleToPlayer = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
@ -2182,6 +2180,8 @@ void EnHorse_CsJumpInit(EnHorse* this, PlayState* play, CsCmdActorCue* cue) {
void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) { void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) {
f32 temp_f2; f32 temp_f2;
Vec3s* jointTable;
f32 y;
if (this->cutsceneFlags & 1) { if (this->cutsceneFlags & 1) {
EnHorse_CsMoveToPoint(this, play, cue); EnHorse_CsMoveToPoint(this, play, cue);
@ -2210,9 +2210,6 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) {
} }
if (SkelAnime_Update(&this->skin.skelAnime) || if (SkelAnime_Update(&this->skin.skelAnime) ||
(temp_f2 > 19.0f && this->actor.world.pos.y < (this->actor.floorHeight - this->actor.velocity.y) + 80.0f)) { (temp_f2 > 19.0f && this->actor.world.pos.y < (this->actor.floorHeight - this->actor.velocity.y) + 80.0f)) {
Vec3s* jointTable;
f32 y;
this->cutsceneFlags |= 1; this->cutsceneFlags |= 1;
Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, Audio_PlaySfxGeneral(NA_SE_EV_HORSE_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
@ -3411,8 +3408,9 @@ void EnHorse_UpdatePlayerDir(EnHorse* this, PlayState* play) {
s16 angle; s16 angle;
f32 s; f32 s;
f32 c; f32 c;
Player* player = GET_PLAYER(play);
angle = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y; angle = Actor_WorldYawTowardActor(&this->actor, &player->actor) - this->actor.world.rot.y;
s = Math_SinS(angle); s = Math_SinS(angle);
c = Math_CosS(angle); c = Math_CosS(angle);
if (s > 0.8660254f) { // sin(60 degrees) if (s > 0.8660254f) { // sin(60 degrees)