1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-05-10 02:54:24 +00:00

apply review suggestions

This commit is contained in:
feacur 2025-01-14 13:34:28 +01:00
parent 3504b7db05
commit dee9afcb07
3 changed files with 88 additions and 89 deletions

View file

@ -2,77 +2,77 @@
<!-- Goron -->
<File Name="object_oF1d_map" Segment="6">
<!-- animations -->
<Animation Name="gGoronSobbingAnim" Offset="0x750"/>
<Animation Name="gGoronShakingAnim" Offset="0xD5C"/>
<Animation Name="gGoronUncurlToProneAnim" Offset="0x161C"/>
<Animation Name="gGoronProneAnim" Offset="0x1A00"/>
<Animation Name="gGoronScratchingAnim" Offset="0x21D0"/>
<Animation Name="gGoronWalkingAnim" Offset="0x29A8"/>
<Animation Name="gGoronEyedropsTakenAnim" Offset="0x2D80"/>
<Animation Name="gGoronCryingAnim" Offset="0x3768"/>
<Animation Name="gGoronEyeropsAnim" Offset="0x38E4"/>
<Animation Name="gGoronSobbingAnim" Offset="0x750"/>
<Animation Name="gGoronShakingAnim" Offset="0xD5C"/>
<Animation Name="gGoronUncurlToProneAnim" Offset="0x161C"/>
<Animation Name="gGoronProneAnim" Offset="0x1A00"/>
<Animation Name="gGoronScratchingAnim" Offset="0x21D0"/>
<Animation Name="gGoronWalkingAnim" Offset="0x29A8"/>
<Animation Name="gGoronEyedropsTakenAnim" Offset="0x2D80"/>
<Animation Name="gGoronCryingAnim" Offset="0x3768"/>
<Animation Name="gGoronEyedropsAnim" Offset="0x38E4"/>
<Animation Name="gGoronUncurlSitStandAnim" Offset="0x4930"/>
<Animation Name="gGoronSidestepAnim" Offset="0x10590"/>
<Animation Name="gGoronSidestepAnim" Offset="0x10590"/>
<!-- skeleton, limb none -->
<Skeleton Name="gGoronSkel" Type="Flex" LimbType="Standard" Offset="0xFEF0"/>
<!-- limbs -->
<Limb Name="gGoronRootLimb" LimbType="Standard" Offset="0xFDE0"/>
<Limb Name="gGoronWaistLimb" LimbType="Standard" Offset="0xFDEC"/>
<Limb Name="gGoronLegsLimb" LimbType="Standard" Offset="0xFDF8"/>
<Limb Name="gGoronLeftThighLimb" LimbType="Standard" Offset="0xFE04"/>
<Limb Name="gGoronLeftShinLimb" LimbType="Standard" Offset="0xFE10"/>
<Limb Name="gGoronLeftFootLimb" LimbType="Standard" Offset="0xFE1C"/>
<Limb Name="gGoronRightThighLimb" LimbType="Standard" Offset="0xFE28"/>
<Limb Name="gGoronRightShinLimb" LimbType="Standard" Offset="0xFE34"/>
<Limb Name="gGoronRightFootLimb" LimbType="Standard" Offset="0xFE40"/>
<Limb Name="gGoronTorsoLimb" LimbType="Standard" Offset="0xFE4C"/>
<Limb Name="gGoronLeftArmLimb" LimbType="Standard" Offset="0xFE58"/>
<Limb Name="gGoronLeftForearmLimb" LimbType="Standard" Offset="0xFE64"/>
<Limb Name="gGoronLeftHandLimb" LimbType="Standard" Offset="0xFE70"/>
<Limb Name="gGoronRightArmLimb" LimbType="Standard" Offset="0xFE7C"/>
<Limb Name="gGoronRootLimb" LimbType="Standard" Offset="0xFDE0"/>
<Limb Name="gGoronWaistLimb" LimbType="Standard" Offset="0xFDEC"/>
<Limb Name="gGoronLegsLimb" LimbType="Standard" Offset="0xFDF8"/>
<Limb Name="gGoronLeftThighLimb" LimbType="Standard" Offset="0xFE04"/>
<Limb Name="gGoronLeftShinLimb" LimbType="Standard" Offset="0xFE10"/>
<Limb Name="gGoronLeftFootLimb" LimbType="Standard" Offset="0xFE1C"/>
<Limb Name="gGoronRightThighLimb" LimbType="Standard" Offset="0xFE28"/>
<Limb Name="gGoronRightShinLimb" LimbType="Standard" Offset="0xFE34"/>
<Limb Name="gGoronRightFootLimb" LimbType="Standard" Offset="0xFE40"/>
<Limb Name="gGoronTorsoLimb" LimbType="Standard" Offset="0xFE4C"/>
<Limb Name="gGoronLeftArmLimb" LimbType="Standard" Offset="0xFE58"/>
<Limb Name="gGoronLeftForearmLimb" LimbType="Standard" Offset="0xFE64"/>
<Limb Name="gGoronLeftHandLimb" LimbType="Standard" Offset="0xFE70"/>
<Limb Name="gGoronRightArmLimb" LimbType="Standard" Offset="0xFE7C"/>
<Limb Name="gGoronRightForearmLimb" LimbType="Standard" Offset="0xFE88"/>
<Limb Name="gGoronRightHandLimb" LimbType="Standard" Offset="0xFE94"/>
<Limb Name="gGoronHeadLimb" LimbType="Standard" Offset="0xFEA0"/>
<Limb Name="gGoronRightHandLimb" LimbType="Standard" Offset="0xFE94"/>
<Limb Name="gGoronHeadLimb" LimbType="Standard" Offset="0xFEA0"/>
<!-- limb display lists -->
<DList Name="gGoronWaistDL" Offset="0x8708"/>
<DList Name="gGoronLeftThighDL" Offset="0x8C80"/>
<DList Name="gGoronLeftShinDL" Offset="0x8D70"/>
<DList Name="gGoronLeftFootDL" Offset="0x8EC0"/>
<DList Name="gGoronRightThighDL" Offset="0x87D0"/>
<DList Name="gGoronRightShinDL" Offset="0x88C0"/>
<DList Name="gGoronRightFootDL" Offset="0x8A10"/>
<DList Name="gGoronTorsoDL" Offset="0x6F90"/>
<DList Name="gGoronLeftArmDL" Offset="0x8218"/>
<DList Name="gGoronLeftForearmDL" Offset="0x83A0"/>
<DList Name="gGoronLeftHandDL" Offset="0x84E0"/>
<DList Name="gGoronRightArmDL" Offset="0x7D28"/>
<DList Name="gGoronWaistDL" Offset="0x8708"/>
<DList Name="gGoronLeftThighDL" Offset="0x8C80"/>
<DList Name="gGoronLeftShinDL" Offset="0x8D70"/>
<DList Name="gGoronLeftFootDL" Offset="0x8EC0"/>
<DList Name="gGoronRightThighDL" Offset="0x87D0"/>
<DList Name="gGoronRightShinDL" Offset="0x88C0"/>
<DList Name="gGoronRightFootDL" Offset="0x8A10"/>
<DList Name="gGoronTorsoDL" Offset="0x6F90"/>
<DList Name="gGoronLeftArmDL" Offset="0x8218"/>
<DList Name="gGoronLeftForearmDL" Offset="0x83A0"/>
<DList Name="gGoronLeftHandDL" Offset="0x84E0"/>
<DList Name="gGoronRightArmDL" Offset="0x7D28"/>
<DList Name="gGoronRightForearmDL" Offset="0x7EB0"/>
<DList Name="gGoronRightHandDL" Offset="0x7FF0"/>
<DList Name="gGoronHeadDL" Offset="0x7458"/>
<DList Name="gGoronRightHandDL" Offset="0x7FF0"/>
<DList Name="gGoronHeadDL" Offset="0x7458"/>
<!-- states display lists -->
<DList Name="gGoronCurledUpDL" Offset="0xBD80"/>
<DList Name="gGoronRollingDL" Offset="0xC140"/>
<DList Name="gGoronCurledUpDL" Offset="0xBD80"/>
<DList Name="gGoronRollingDL" Offset="0xC140"/>
<!-- effects display lists -->
<DList Name="gGoronParticleMaterialDL" Offset="0xFD40"/>
<DList Name="gGoronParticleDL" Offset="0xFD50"/>
<DList Name="gGoronParticleDL" Offset="0xFD50"/>
<!-- palettes -->
<Texture Name="object_oF1d_map_TLUT_00C640" OutName="tlut_0000C640" Format="rgba16" Width="16" Height="16" Offset="0xC640"/>
<!-- Eye textures -->
<Texture Name="gGoronCsEyeOpenTex" OutName="eye_open" Format="ci8" Width="32" Height="32" Offset="0xCE80" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeHalfTex" OutName="eye_half" Format="ci8" Width="32" Height="32" Offset="0xD280" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeClosedTex" OutName="eye_closed" Format="ci8" Width="32" Height="32" Offset="0xD680" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeOpenTex" OutName="eye_open" Format="ci8" Width="32" Height="32" Offset="0xCE80" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeHalfTex" OutName="eye_half" Format="ci8" Width="32" Height="32" Offset="0xD280" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeClosedTex" OutName="eye_closed" Format="ci8" Width="32" Height="32" Offset="0xD680" TlutOffset="0xC640"/>
<Texture Name="gGoronCsEyeClosed2Tex" OutName="eye_closed2" Format="ci8" Width="32" Height="32" Offset="0xDA80" TlutOffset="0xC640"/>
<!-- Mouth textures -->
<Texture Name="gGoronCsMouthNeutralTex" OutName="mouth_neutral" Format="ci8" Width="64" Height="32" Offset="0xDE80" TlutOffset="0xC640"/>
<Texture Name="gGoronCsMouthSmileTex" OutName="mouth_smile" Format="ci8" Width="64" Height="32" Offset="0xE680" TlutOffset="0xC640"/>
<Texture Name="gGoronCsMouthSmileTex" OutName="mouth_smile" Format="ci8" Width="64" Height="32" Offset="0xE680" TlutOffset="0xC640"/>
</File>
</Root>

View file

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

View file

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