diff --git a/assets/xml/objects/object_oF1d_map.xml b/assets/xml/objects/object_oF1d_map.xml index 501a89dc99..821149a7bf 100644 --- a/assets/xml/objects/object_oF1d_map.xml +++ b/assets/xml/objects/object_oF1d_map.xml @@ -2,77 +2,77 @@ - - - - - - - - - + + + + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - + + - - + + - + - - - + + + - + diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index b4cea89e47..c058b8dfba 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -142,7 +142,7 @@ static AnimationInfo sAnimationInfo[] = { { &gGoronWalkingAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronSidestepAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronCryingAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, - { &gGoronEyeropsAnim, 1.0f, 0.0f, -1.0f, 0x02, -8.0f }, + { &gGoronEyedropsAnim, 1.0f, 0.0f, -1.0f, 0x02, -8.0f }, { &gGoronEyedropsTakenAnim, 1.0f, 0.0f, -1.0f, 0x02, -8.0f }, { &gGoronUncurlToProneAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, { &gGoronProneAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f }, @@ -254,8 +254,8 @@ void EnGo2_DrawEffects(EnGo2* this, PlayState* play) { CLOSE_DISPS(play->state.gfxCtx, "../z_en_go2_eff.c", 151); } -s32 EnGo2_SpawnDustExplicitly(EnGo2* this, u8 initialTimer, f32 scale, f32 scaleStep, s32 numDustEffects, f32 radius, - f32 yAccel) { +s32 EnGo2_SpawnDustImpl(EnGo2* this, u8 initialTimer, f32 scale, f32 scaleStep, s32 numDustEffects, f32 radius, + f32 yAccel) { Vec3f pos = sPos; Vec3f velocity = sVelocity; Vec3f accel = sAccel; @@ -828,7 +828,7 @@ s32 EnGo2_UpdateTalking(EnGo2* this, PlayState* play) { EnGo2_GetTextId, EnGo2_UpdateTalkState); } - // Biggoron is close enough; see `EnGo2_IsWithinInteactionRange` + // Biggoron is close enough; see `EnGo2_IsWithinInteractionRange` if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { return false; } @@ -974,7 +974,7 @@ s32 EnGo2_OrientInstant(EnGo2* this) { return 1; } -s32 EnGo2_IsWithinInteactionRange(EnGo2* this) { +s32 EnGo2_IsWithinInteractionRange(EnGo2* this) { s16 yawDiff; f32 xyzDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 800.0f : 200.0f; f32 yDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 400.0f : 60.0f; @@ -1001,12 +1001,12 @@ s32 EnGo2_IsWithinInteactionRange(EnGo2* this) { } } -s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 bounceCount, f32 boundSpeed, s16 rumble) { +s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 bounceCount, f32 bounceSpeed, s16 rumble) { if (!(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || this->actor.velocity.y > 0.0f) { return false; } - // rumble on odds and evens + // animate grounded shaking if (DECR(this->bounceTimer)) { if (!rumble) { return true; @@ -1019,27 +1019,25 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 bounceCount, f32 boundSpeed, s16 ru } // bounce! - { - if (this->bounceCounter >= 2) { - Actor_PlaySfx(&this->actor, (ENGO2_GET_TYPE(this) == GORON_CITY_HOT_RODDER) ? NA_SE_EN_GOLON_LAND_BIG - : NA_SE_EN_DODO_M_GND); - } - - this->bounceCounter--; - if (this->bounceCounter <= 0) { - if (this->bounceCounter == 0) { - this->bounceTimer = Rand_S16Offset(60, 30); - this->bounceCounter = 0; - this->actor.velocity.y = 0.0f; - return true; - } else { - this->bounceCounter = bounceCount; - } - } - - this->actor.velocity.y = ((f32)this->bounceCounter / (f32)bounceCount) * boundSpeed; - return true; + if (this->bounceCounter >= 2) { + Actor_PlaySfx(&this->actor, + (ENGO2_GET_TYPE(this) == GORON_CITY_HOT_RODDER) ? NA_SE_EN_GOLON_LAND_BIG : NA_SE_EN_DODO_M_GND); } + + this->bounceCounter--; + if (this->bounceCounter <= 0) { + if (this->bounceCounter == 0) { + this->bounceTimer = Rand_S16Offset(60, 30); + this->bounceCounter = 0; + this->actor.velocity.y = 0.0f; + return true; + } else { + this->bounceCounter = bounceCount; + } + } + + this->actor.velocity.y = ((f32)this->bounceCounter / (f32)bounceCount) * bounceSpeed; + return true; } void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { @@ -1179,10 +1177,10 @@ s32 EnGo2_ShouldStay(EnGo2* this, PlayState* play) { Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) { - if (EnGo2_IsWithinInteactionRange(this)) { + if (EnGo2_IsWithinInteractionRange(this)) { Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW); Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG); - } else if (!EnGo2_IsWithinInteactionRange(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) { + } else if (!EnGo2_IsWithinInteractionRange(this) && (mainCam->setting == CAM_SET_DIRECTED_YAW)) { Camera_RequestSetting(mainCam, CAM_SET_DUNGEON1); Camera_SetStateFlag(mainCam, CAM_STATE_CHECK_BG); } @@ -1202,7 +1200,7 @@ s32 EnGo2_ShouldStay(EnGo2* this, PlayState* play) { } void EnGo2_SetupUncurledFlags_Default(EnGo2* this) { - this->trackingMode = EnGo2_IsWithinInteactionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; + this->trackingMode = EnGo2_IsWithinInteractionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; if (this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { this->trackingMode = NPC_TRACKING_FULL_BODY; @@ -1212,7 +1210,8 @@ void EnGo2_SetupUncurledFlags_Default(EnGo2* this) { } void EnGo2_SetupUncurledFlags_NearTracking(EnGo2* this) { - // always false, he wakes up with `EnGo2_SetupUncurledFlags_Biggoron` + // always false: this functions if for `GORON_FIRE_GENERIC` and `GORON_CITY_LINK` + // see `EnGo2_SetupUncurledFlags_Biggoron` for `GORON_DMT_BIGGORON`'s variant f32 xyzDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 800.0f : 200.0f; s32 isTrue = true; @@ -1226,7 +1225,7 @@ void EnGo2_SetupUncurledFlags_NearTracking(EnGo2* this) { } void EnGo2_SetupUncurledFlags_Biggoron(EnGo2* this) { - if (EnGo2_IsWithinInteactionRange(this) || this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { + if (EnGo2_IsWithinInteractionRange(this) || this->interactInfo.talkState != NPC_TALK_STATE_IDLE) { this->trackingMode = NPC_TRACKING_HEAD_AND_TORSO; this->isTalkative = true; } else { @@ -1239,7 +1238,7 @@ void EnGo2_SetupUncurledFlags(EnGo2* this) { switch (ENGO2_GET_TYPE(this)) { case GORON_DMT_BOMB_FLOWER: this->isTalkative = true; - this->trackingMode = EnGo2_IsWithinInteactionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; + this->trackingMode = EnGo2_IsWithinInteractionRange(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; break; case GORON_FIRE_GENERIC: EnGo2_SetupUncurledFlags_NearTracking(this); @@ -1312,8 +1311,8 @@ void EnGo2_SpawnDust(EnGo2* this, s32 index2) { s32 index1 = ENGO2_GET_TYPE(this) == GORON_CITY_HOT_RODDER ? 1 : 0; EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2]; - EnGo2_SpawnDustExplicitly(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, - dustEffectData->numDustEffects, dustEffectData->radius, dustEffectData->yAccel); + EnGo2_SpawnDustImpl(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, + dustEffectData->numDustEffects, dustEffectData->radius, dustEffectData->yAccel); } void EnGo2_SetupCurledUp(EnGo2* this, PlayState* play) { @@ -1446,7 +1445,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { s32 EnGo2_IsGoronLinkReversing(EnGo2* this) { if (ENGO2_GET_TYPE(this) != GORON_CITY_LINK || (this->waypoint >= this->reverseWaypoint) || - !EnGo2_IsWithinInteactionRange(this)) { + !EnGo2_IsWithinInteractionRange(this)) { return false; } return true; @@ -1560,7 +1559,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { EnGo2_SetShape(this); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_UNCURL_SIT_STAND_DEFAULT); this->actor.gravity = -1.0f; - this->shadownAlpha = this->actor.shape.shadowAlpha = 0; + this->shadowAlpha = this->actor.shape.shadowAlpha = 0; this->reverse = 0; this->isTalkative = false; this->isUncurled = false; @@ -1675,7 +1674,7 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) { this->isTalkative = false; EnGo2_WakeUpAnimated(this, play); } - if ((ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) && EnGo2_IsWithinInteactionRange(this)) { + if ((ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) && EnGo2_IsWithinInteractionRange(this)) { EnGo2_WakeUpAnimated(this, play); } } @@ -1710,7 +1709,7 @@ void EnGo2_Standing(EnGo2* this, PlayState* play) { (s16)((height * 0.4f * (this->skelAnime.curFrame / this->skelAnime.endFrame)) + (height * 0.6f)); } } - if ((!EnGo2_ShouldStay(this, play)) && (!EnGo2_IsWithinInteactionRange(this))) { + if ((!EnGo2_ShouldStay(this, play)) && (!EnGo2_IsWithinInteractionRange(this))) { EnGo2_SetupCurledUp(this, play); } } @@ -1765,7 +1764,7 @@ void EnGo2_RollingSlow(EnGo2* this, PlayState* play) { break; case GORON_CITY_LINK: if ((updatedWaypoint == 2) && (this->waypoint == 1)) { - // @unreachable: `EnGo2_FollowPath` returns `0` or `1` + // Unreachable: `EnGo2_FollowPath` returns `0` or `1` EnGo2_StopRolling(this, play); return; } @@ -2000,7 +1999,7 @@ void EnGo2_GoronFireGeneric(EnGo2* this, PlayState* play) { void EnGo2_Update(Actor* thisx, PlayState* play) { EnGo2* this = (EnGo2*)thisx; - EnGo2_UpdateShadowAlpha(this, &this->shadownAlpha); + EnGo2_UpdateShadowAlpha(this, &this->shadowAlpha); EnGo2_PlayStandingChangeSfx(this); SkelAnime_Update(&this->skelAnime); EnGo2_RollForward(this); diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.h b/src/overlays/actors/ovl_En_Go2/z_en_go2.h index 59238f1556..cf1e3197c8 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.h +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.h @@ -93,7 +93,7 @@ typedef struct EnGo2 { /* 0x0216 */ u8 reverseWaypoint; // Set to z rotation, checked by waypoint /* 0x0218 */ f32 interactRange; /* 0x021C */ char unk_21C[0x04]; - /* 0x0220 */ f32 shadownAlpha; + /* 0x0220 */ f32 shadowAlpha; /* 0x0224 */ s16 blinkTimer; /* 0x0226 */ s16 fidgetTableY[GORON_LIMB_MAX]; /* 0x024A */ s16 fidgetTableZ[GORON_LIMB_MAX];