mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-23 15:55:47 +00:00
redocument EnGo2 subtypes as an enum
This commit is contained in:
parent
787b260722
commit
7510ed0852
2 changed files with 70 additions and 81 deletions
|
@ -149,6 +149,24 @@ static AnimationInfo sAnimationInfo[] = {
|
|||
{ &gGoronShakingLoopAnim, 1.0f, 0.0f, -1.0f, 0x00, -8.0f },
|
||||
};
|
||||
|
||||
#define ENGO2_GET_TYPE(this) PARAMS_GET_S((this)->actor.params, 0, 5)
|
||||
typedef enum GoronType {
|
||||
/* 0x00 */ GORON_CITY_ROLLING_BIG,
|
||||
/* 0x01 */ GORON_CITY_LINK,
|
||||
/* 0x02 */ GORON_DMT_BIGGORON,
|
||||
/* 0x03 */ GORON_FIRE_GENERIC,
|
||||
/* 0x04 */ GORON_DMT_BOMB_FLOWER,
|
||||
/* 0x05 */ GORON_DMT_ROLLING_SMALL,
|
||||
/* 0x06 */ GORON_DMT_DC_ENTRANCE,
|
||||
/* 0x07 */ GORON_CITY_ENTRANCE,
|
||||
/* 0x08 */ GORON_CITY_ISLAND,
|
||||
/* 0x09 */ GORON_CITY_LOWEST_FLOOR,
|
||||
/* 0x0A */ GORON_CITY_STAIRWELL,
|
||||
/* 0x0B */ GORON_CITY_LOST_WOODS,
|
||||
/* 0x0C */ GORON_DMT_FAIRY_HINT,
|
||||
/* 0x0D */ GORON_MARKET_BAZAAR
|
||||
} GoronType;
|
||||
|
||||
static EnGo2DustEffectData sDustEffectData[2][4] = {
|
||||
{
|
||||
{ 12, 0.2f, 0.2f, 1, 18.0f, 0.0f },
|
||||
|
@ -742,7 +760,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) {
|
|||
if (textId != 0) {
|
||||
return textId;
|
||||
} else {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
return EnGo2_GetTextIdGoronCityRollingBig(play, this);
|
||||
case GORON_CITY_LINK:
|
||||
|
@ -780,7 +798,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) {
|
|||
|
||||
s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) {
|
||||
EnGo2* this = (EnGo2*)thisx;
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
return EnGo2_UpdateTalkStateGoronCityRollingBig(play, this);
|
||||
case GORON_CITY_LINK:
|
||||
|
@ -818,12 +836,10 @@ s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) {
|
|||
}
|
||||
|
||||
s32 func_80A44790(EnGo2* this, PlayState* play) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON &&
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_DMT_BIGGORON && ENGO2_GET_TYPE(this) != GORON_CITY_ROLLING_BIG) {
|
||||
return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange,
|
||||
EnGo2_GetTextId, EnGo2_UpdateTalkState);
|
||||
} else if ((PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) &&
|
||||
!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
|
||||
} else if ((ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
|
||||
return false;
|
||||
} else {
|
||||
if (Actor_TalkOfferAccepted(&this->actor, play)) {
|
||||
|
@ -840,14 +856,14 @@ s32 func_80A44790(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_SetColliderDim(EnGo2* this) {
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
u8 index = ENGO2_GET_TYPE(this);
|
||||
|
||||
this->collider.dim.radius = D_80A4816C[index].radius;
|
||||
this->collider.dim.height = D_80A4816C[index].height;
|
||||
}
|
||||
|
||||
void EnGo2_SetShape(EnGo2* this) {
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
u8 index = ENGO2_GET_TYPE(this);
|
||||
|
||||
this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10;
|
||||
Actor_SetScale(&this->actor, D_80A481F8[index].scale);
|
||||
|
@ -863,10 +879,10 @@ void EnGo2_CheckCollision(EnGo2* this, PlayState* play) {
|
|||
pos.x = this->actor.world.pos.x;
|
||||
pos.y = this->actor.world.pos.y;
|
||||
pos.z = this->actor.world.pos.z;
|
||||
xzDist = D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].xzDist;
|
||||
xzDist = D_80A4816C[ENGO2_GET_TYPE(this)].xzDist;
|
||||
pos.x += (s16)(xzDist * Math_SinS(this->actor.shape.rot.y));
|
||||
pos.z += (s16)(xzDist * Math_CosS(this->actor.shape.rot.y));
|
||||
pos.y += D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].yDist;
|
||||
pos.y += D_80A4816C[ENGO2_GET_TYPE(this)].yDist;
|
||||
this->collider.dim.pos = pos;
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
|
@ -884,7 +900,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) {
|
|||
Player* player = GET_PLAYER(play);
|
||||
f32 arg2;
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
return false;
|
||||
} else {
|
||||
if ((this->actionFunc != EnGo2_ActionRollingSlow) && (this->actionFunc != EnGo2_ActionRollingReverse) &&
|
||||
|
@ -964,11 +980,11 @@ s32 func_80A44D84(EnGo2* this) {
|
|||
|
||||
s32 EnGo2_IsAttentionDrawn(EnGo2* this) {
|
||||
s16 yawDiff;
|
||||
f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f;
|
||||
f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f;
|
||||
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;
|
||||
s16 yawDiffAbs;
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
|
||||
return false;
|
||||
|
@ -1010,9 +1026,8 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 bounceCount, f32 boundSpeed, s16 ru
|
|||
// bounce!
|
||||
{
|
||||
if (this->bounceCounter >= 2) {
|
||||
Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG)
|
||||
? NA_SE_EN_GOLON_LAND_BIG
|
||||
: NA_SE_EN_DODO_M_GND);
|
||||
Actor_PlaySfx(&this->actor, (ENGO2_GET_TYPE(this) == GORON_CITY_ROLLING_BIG) ? NA_SE_EN_GOLON_LAND_BIG
|
||||
: NA_SE_EN_DODO_M_GND);
|
||||
}
|
||||
|
||||
this->bounceCounter--;
|
||||
|
@ -1035,7 +1050,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 bounceCount, f32 boundSpeed, s16 ru
|
|||
void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
|
||||
u16 textId;
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
if (gSaveContext.save.info.playerData.bgsFlag) {
|
||||
if (Player_GetExchangeItemId(play) == EXCH_ITEM_CLAIM_CHECK) {
|
||||
this->actor.textId = 0x3003;
|
||||
|
@ -1099,7 +1114,7 @@ void func_80A45288(EnGo2* this, PlayState* play) {
|
|||
if (this->actionFunc != EnGo2_GoronFireGenericAction) {
|
||||
this->interactInfo.trackPos = player->actor.world.pos;
|
||||
this->interactInfo.yOffset =
|
||||
sPlayerTrackingYOffsets[PARAMS_GET_S(this->actor.params, 0, 5)][((void)0, gSaveContext.save.linkAge)];
|
||||
sPlayerTrackingYOffsets[ENGO2_GET_TYPE(this)][((void)0, gSaveContext.save.linkAge)];
|
||||
Npc_TrackPoint(&this->actor, &this->interactInfo, 4, this->trackingMode);
|
||||
}
|
||||
if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) {
|
||||
|
@ -1132,7 +1147,7 @@ void EnGo2_RollForward(EnGo2* this) {
|
|||
}
|
||||
|
||||
void func_80A454CC(EnGo2* this) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
case GORON_DMT_DC_ENTRANCE:
|
||||
case GORON_CITY_ENTRANCE:
|
||||
|
@ -1154,8 +1169,8 @@ void func_80A454CC(EnGo2* this) {
|
|||
}
|
||||
|
||||
f32 EnGo2_GetTargetXZSpeed(EnGo2* this) {
|
||||
f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f;
|
||||
s32 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
f32 yDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 400.0f : 60.0f;
|
||||
s32 index = ENGO2_GET_TYPE(this);
|
||||
|
||||
if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) &&
|
||||
(this->actor.xzDistToPlayer < 400.0f)) {
|
||||
|
@ -1168,7 +1183,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) {
|
|||
s32 EnGo2_IsAttentionDrawnExtented(EnGo2* this, PlayState* play) {
|
||||
Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN];
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
if (EnGo2_IsAttentionDrawn(this)) {
|
||||
Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW);
|
||||
Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG);
|
||||
|
@ -1178,11 +1193,9 @@ s32 EnGo2_IsAttentionDrawnExtented(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_FIRE_GENERIC ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_STAIRWELL ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_MARKET_BAZAAR) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_FIRE_GENERIC || ENGO2_GET_TYPE(this) == GORON_CITY_ROLLING_BIG ||
|
||||
ENGO2_GET_TYPE(this) == GORON_CITY_STAIRWELL || (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ||
|
||||
ENGO2_GET_TYPE(this) == GORON_MARKET_BAZAAR) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1208,7 +1221,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_WakingUp(EnGo2* this) {
|
||||
f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f;
|
||||
f32 xyzDist = (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) ? 800.0f : 200.0f;
|
||||
s32 isTrue = true;
|
||||
|
||||
xyzDist = SQ(xyzDist);
|
||||
|
@ -1231,7 +1244,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_SelectGoronWakingUp(EnGo2* this) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_DMT_BOMB_FLOWER:
|
||||
this->isAwake = true;
|
||||
this->trackingMode = EnGo2_IsAttentionDrawn(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
|
||||
|
@ -1286,7 +1299,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) {
|
|||
void EnGo2_SitDownAnimation(EnGo2* this) {
|
||||
if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronUncurlSitStandAnim)) {
|
||||
if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_DMT_BIGGORON) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_DOWN);
|
||||
} else {
|
||||
func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60);
|
||||
|
@ -1304,7 +1317,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_GetDustData(EnGo2* this, s32 index2) {
|
||||
s32 index1 = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0;
|
||||
s32 index1 = ENGO2_GET_TYPE(this) == GORON_CITY_ROLLING_BIG ? 1 : 0;
|
||||
EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2];
|
||||
|
||||
EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep,
|
||||
|
@ -1312,7 +1325,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) {
|
|||
}
|
||||
|
||||
void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_UNCURL_SIT_STAND_BIG);
|
||||
this->skelAnime.playSpeed = -0.5f;
|
||||
|
@ -1329,13 +1342,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) {
|
|||
|
||||
void EnGo2_WakeUp(EnGo2* this, PlayState* play) {
|
||||
if (this->skelAnime.playSpeed == 0.0f) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_DMT_BIGGORON) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WAKE_UP);
|
||||
} else {
|
||||
func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60);
|
||||
}
|
||||
}
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN);
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_UNCURL_SIT_STAND_BIG);
|
||||
this->skelAnime.playSpeed = 0.5f;
|
||||
|
@ -1356,8 +1369,7 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_CITY_ROLLING_BIG || ENGO2_GET_TYPE(this) == GORON_CITY_LINK) {
|
||||
this->collider.elem.acElemFlags = ACELEM_ON;
|
||||
this->actor.speed = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f;
|
||||
} else {
|
||||
|
@ -1373,9 +1385,8 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
|
|||
void EnGo2_StopRolling(EnGo2* this, PlayState* play) {
|
||||
EnBom* bomb;
|
||||
|
||||
if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) &&
|
||||
(PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK)) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_ROLLING_SMALL) {
|
||||
if ((ENGO2_GET_TYPE(this) != GORON_CITY_ROLLING_BIG) && (ENGO2_GET_TYPE(this) != GORON_CITY_LINK)) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_ROLLING_SMALL) {
|
||||
bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x,
|
||||
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0);
|
||||
if (bomb != NULL) {
|
||||
|
@ -1395,7 +1406,7 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1408,8 +1419,7 @@ s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER ||
|
||||
this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_DMT_BOMB_FLOWER || this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1422,8 +1432,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG ||
|
||||
(this->interactInfo.talkState != NPC_TALK_STATE_ACTION)) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_CITY_ROLLING_BIG || (this->interactInfo.talkState != NPC_TALK_STATE_ACTION)) {
|
||||
return false;
|
||||
}
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
|
@ -1433,8 +1442,7 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronFireGeneric(EnGo2* this) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC ||
|
||||
this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
if (ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC || this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
return false;
|
||||
}
|
||||
this->actionFunc = EnGo2_GoronFireGenericAction;
|
||||
|
@ -1442,7 +1450,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronLinkReversing(EnGo2* this) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->reverseWaypoint) ||
|
||||
if (ENGO2_GET_TYPE(this) != GORON_CITY_LINK || (this->waypoint >= this->reverseWaypoint) ||
|
||||
!EnGo2_IsAttentionDrawn(this)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1465,7 +1473,7 @@ s32 EnGo2_IsRolling(EnGo2* this) {
|
|||
void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) {
|
||||
s32 animation = ARRAY_COUNT(sAnimationInfo);
|
||||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_CITY_LINK) {
|
||||
if ((this->actor.textId == 0x3035 && this->messageEntry == 0) ||
|
||||
(this->actor.textId == 0x3036 && this->messageEntry == 0)) {
|
||||
if (this->skelAnime.animation != &gGoronShakingLoopAnim) {
|
||||
|
@ -1518,8 +1526,7 @@ void EnGo2_GoronFireClearCamera(EnGo2* this, PlayState* play) {
|
|||
|
||||
void EnGo2_BiggoronAnimation(EnGo2* this) {
|
||||
if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_BROKEN_GORONS_SWORD && INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYE_DROPS &&
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON &&
|
||||
this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
(ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
if (DECR(this->animTimer) == 0) {
|
||||
this->animTimer = Rand_S16Offset(30, 30);
|
||||
func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_EYE_BIG, 60);
|
||||
|
@ -1538,7 +1545,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
|
||||
// Not GORON_CITY_ROLLING_BIG, GORON_CITY_LINK, GORON_DMT_BIGGORON
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_FIRE_GENERIC:
|
||||
case GORON_DMT_BOMB_FLOWER:
|
||||
case GORON_DMT_ROLLING_SMALL:
|
||||
|
@ -1567,7 +1574,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||
this->reverseWaypoint = this->actor.shape.rot.z;
|
||||
this->trackingMode = NPC_TRACKING_NONE;
|
||||
this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 5, 5), 0x1F);
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_CITY_ENTRANCE:
|
||||
case GORON_CITY_ISLAND:
|
||||
case GORON_CITY_LOWEST_FLOOR:
|
||||
|
@ -1598,14 +1605,14 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||
#if OOT_VERSION >= PAL_1_1
|
||||
CLEAR_INFTABLE(INFTABLE_10C);
|
||||
#endif
|
||||
this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f);
|
||||
this->collider.dim.height = (D_80A4816C[ENGO2_GET_TYPE(this)].height * 0.6f);
|
||||
EnGo2_SetupRolling(this, play);
|
||||
this->isAwake = true;
|
||||
}
|
||||
break;
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
case GORON_DMT_ROLLING_SMALL:
|
||||
this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f);
|
||||
this->collider.dim.height = (D_80A4816C[ENGO2_GET_TYPE(this)].height * 0.6f);
|
||||
EnGo2_SetupRolling(this, play);
|
||||
break;
|
||||
case GORON_FIRE_GENERIC:
|
||||
|
@ -1645,12 +1652,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_ActionCurledUp(EnGo2* this, PlayState* play) {
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
u8 index = ENGO2_GET_TYPE(this);
|
||||
s16 height;
|
||||
s32 quakeIndex;
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, -0x3CB0);
|
||||
Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0);
|
||||
|
@ -1673,13 +1680,13 @@ void EnGo2_ActionCurledUp(EnGo2* this, PlayState* play) {
|
|||
this->isAwake = false;
|
||||
EnGo2_WakeUp(this, play);
|
||||
}
|
||||
if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsAttentionDrawn(this)) {
|
||||
if ((ENGO2_GET_TYPE(this) != GORON_FIRE_GENERIC) && EnGo2_IsAttentionDrawn(this)) {
|
||||
EnGo2_WakeUp(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A46B40(EnGo2* this, PlayState* play) {
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
u8 index = ENGO2_GET_TYPE(this);
|
||||
f32 height;
|
||||
|
||||
if (this->isUncurled == true) {
|
||||
|
@ -1696,7 +1703,7 @@ void func_80A46B40(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
} else {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (ENGO2_GET_TYPE(this) == GORON_DMT_BIGGORON) {
|
||||
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED;
|
||||
}
|
||||
func_80A454CC(this);
|
||||
|
@ -1734,8 +1741,7 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) {
|
|||
void EnGo2_ActionRollingContinue(EnGo2* this, PlayState* play) {
|
||||
f32 float1 = 1000.0f;
|
||||
|
||||
if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL ||
|
||||
!(this->actor.xyzDistToPlayerSq > SQ(float1))) &&
|
||||
if ((ENGO2_GET_TYPE(this) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) &&
|
||||
DECR(this->animTimer) == 0) {
|
||||
this->actionFunc = EnGo2_ActionRollingSlow;
|
||||
this->actor.speed *= 0.5f; // slowdown
|
||||
|
@ -1756,7 +1762,7 @@ void EnGo2_ActionRollingSlow(EnGo2* this, PlayState* play) {
|
|||
EnGo2_GetDustData(this, 3);
|
||||
}
|
||||
orientation = EnGo2_Orient(this, play);
|
||||
index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
index = ENGO2_GET_TYPE(this);
|
||||
if (index != GORON_CITY_LINK) {
|
||||
if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) {
|
||||
EnGo2_StopRolling(this, play);
|
||||
|
@ -1775,7 +1781,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) {
|
|||
if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) {
|
||||
EnGo2_GetDustData(this, 0);
|
||||
if (this->bounceCounter == 0) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
switch (ENGO2_GET_TYPE(this)) {
|
||||
case GORON_CITY_LINK:
|
||||
this->goronState = 0;
|
||||
this->actionFunc = EnGo2_GoronLinkStopRolling;
|
||||
|
|
|
@ -9,23 +9,6 @@ struct EnGo2;
|
|||
|
||||
typedef void (*EnGo2ActionFunc)(struct EnGo2*, PlayState*);
|
||||
|
||||
typedef enum GoronType {
|
||||
/* 0x00 */ GORON_CITY_ROLLING_BIG,
|
||||
/* 0x01 */ GORON_CITY_LINK,
|
||||
/* 0x02 */ GORON_DMT_BIGGORON,
|
||||
/* 0x03 */ GORON_FIRE_GENERIC,
|
||||
/* 0x04 */ GORON_DMT_BOMB_FLOWER,
|
||||
/* 0x05 */ GORON_DMT_ROLLING_SMALL,
|
||||
/* 0x06 */ GORON_DMT_DC_ENTRANCE,
|
||||
/* 0x07 */ GORON_CITY_ENTRANCE,
|
||||
/* 0x08 */ GORON_CITY_ISLAND,
|
||||
/* 0x09 */ GORON_CITY_LOWEST_FLOOR,
|
||||
/* 0x0A */ GORON_CITY_STAIRWELL,
|
||||
/* 0x0B */ GORON_CITY_LOST_WOODS,
|
||||
/* 0x0C */ GORON_DMT_FAIRY_HINT,
|
||||
/* 0x0D */ GORON_MARKET_BAZAAR
|
||||
} GoronType;
|
||||
|
||||
// WIP fire temple type docs
|
||||
// /* 0x00 */ UNUSED
|
||||
// /* 0x01 */ GORON_FIRE_LAVA_ROOM_OPEN
|
||||
|
|
Loading…
Add table
Reference in a new issue