mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 14:31:17 +00:00
Generic actor params getters (#1359)
* Initial PARAMS_GET macros * NOSHIFT macro * Use number of bits rather than raw mask values * Add descriptions for each generic macro * Reformat * Adjust comment * format * edit en_door macro names * edit redead macro name * edit bdan switch macro name, and remove unneeded comments in go2 * mizushutter macro names * remove PARAMS_GET_S, rework ishi switch flag handling * actually remove PARAMS_GET_S * remove PARAMS_GET2_S * PARAMS_GET_U and PARAMS_GET_S * format * fix merge * format --------- Co-authored-by: fig02 <fig02srl@gmail.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
137e0d2a10
commit
eaf955ad22
200 changed files with 1113 additions and 1045 deletions
|
@ -32,15 +32,6 @@ INFTABLE_10F - (not on cloud modding)
|
|||
|
||||
INFTABLE_11E - Bomb bag upgrade obtained from rolling Goron
|
||||
|
||||
EnGo
|
||||
pathIndex: this->actor.params & 0xF
|
||||
Goron: this->actor.params & 0xF0
|
||||
|
||||
EnGo2
|
||||
(this->actor.params & 0x3E0) >> 5
|
||||
(this->actor.params & 0xFC00) >> 0xA - Gorons in Fire Temple
|
||||
this->actor.params & 0x1F
|
||||
|
||||
Gorons only move when this->interactInfo.talkState == NPC_TALK_STATE_IDLE
|
||||
*/
|
||||
|
||||
|
@ -296,7 +287,7 @@ s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) {
|
||||
switch ((this->actor.params & 0xFC00) >> 0xA) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 10, 6)) {
|
||||
case 3:
|
||||
return 0x3069;
|
||||
case 5:
|
||||
|
@ -641,7 +632,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) {
|
|||
}
|
||||
|
||||
u16 EnGo2_GetTextIdGoronFireGeneric(PlayState* play, EnGo2* this) {
|
||||
if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) {
|
||||
if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) {
|
||||
return 0x3071;
|
||||
} else {
|
||||
return 0x3051;
|
||||
|
@ -741,7 +732,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) {
|
|||
if (textId != 0) {
|
||||
return textId;
|
||||
} else {
|
||||
switch (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
return EnGo2_GetTextIdGoronCityRollingBig(play, this);
|
||||
case GORON_CITY_LINK:
|
||||
|
@ -779,7 +770,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) {
|
|||
|
||||
s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) {
|
||||
EnGo2* this = (EnGo2*)thisx;
|
||||
switch (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
return EnGo2_UpdateTalkStateGoronCityRollingBig(play, this);
|
||||
case GORON_CITY_LINK:
|
||||
|
@ -817,10 +808,11 @@ s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) {
|
|||
}
|
||||
|
||||
s32 func_80A44790(EnGo2* this, PlayState* play) {
|
||||
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON && (this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON &&
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) {
|
||||
return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange,
|
||||
EnGo2_GetTextId, EnGo2_UpdateTalkState);
|
||||
} else if (((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) &&
|
||||
} else if ((PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) &&
|
||||
!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -838,14 +830,14 @@ s32 func_80A44790(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_SetColliderDim(EnGo2* this) {
|
||||
u8 index = this->actor.params & 0x1F;
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
|
||||
this->collider.dim.radius = D_80A4816C[index].radius;
|
||||
this->collider.dim.height = D_80A4816C[index].height;
|
||||
}
|
||||
|
||||
void EnGo2_SetShape(EnGo2* this) {
|
||||
u8 index = this->actor.params & 0x1F;
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
|
||||
this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10;
|
||||
Actor_SetScale(&this->actor, D_80A481F8[index].scale);
|
||||
|
@ -861,10 +853,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[this->actor.params & 0x1F].xzDist;
|
||||
xzDist = D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].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[this->actor.params & 0x1F].yDist;
|
||||
pos.y += D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].yDist;
|
||||
this->collider.dim.pos = pos;
|
||||
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
|
||||
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
|
||||
|
@ -882,7 +874,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) {
|
|||
Player* player = GET_PLAYER(play);
|
||||
f32 arg2;
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
return false;
|
||||
} else {
|
||||
if ((this->actionFunc != EnGo2_SlowRolling) && (this->actionFunc != EnGo2_ReverseRolling) &&
|
||||
|
@ -962,11 +954,11 @@ s32 func_80A44D84(EnGo2* this) {
|
|||
|
||||
s32 EnGo2_IsWakingUp(EnGo2* this) {
|
||||
s16 yawDiff;
|
||||
f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f;
|
||||
f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f;
|
||||
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;
|
||||
s16 yawDiffAbs;
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
return false;
|
||||
|
@ -1003,8 +995,9 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) {
|
|||
}
|
||||
|
||||
if (this->unk_59C >= 2) {
|
||||
Actor_PlaySfx(&this->actor, (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ? NA_SE_EN_GOLON_LAND_BIG
|
||||
: NA_SE_EN_DODO_M_GND);
|
||||
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);
|
||||
}
|
||||
|
||||
this->unk_59C--;
|
||||
|
@ -1026,7 +1019,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) {
|
|||
void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) {
|
||||
u16 textId;
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (gSaveContext.save.info.playerData.bgsFlag) {
|
||||
if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) {
|
||||
this->actor.textId = 0x3003;
|
||||
|
@ -1090,7 +1083,7 @@ void func_80A45288(EnGo2* this, PlayState* play) {
|
|||
if (this->actionFunc != EnGo2_GoronFireGenericAction) {
|
||||
this->interactInfo.trackPos = player->actor.world.pos;
|
||||
this->interactInfo.yOffset =
|
||||
sPlayerTrackingYOffsets[this->actor.params & 0x1F][((void)0, gSaveContext.save.linkAge)];
|
||||
sPlayerTrackingYOffsets[PARAMS_GET_S(this->actor.params, 0, 5)][((void)0, gSaveContext.save.linkAge)];
|
||||
Npc_TrackPoint(&this->actor, &this->interactInfo, 4, this->trackingMode);
|
||||
}
|
||||
if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) {
|
||||
|
@ -1123,7 +1116,7 @@ void EnGo2_RollForward(EnGo2* this) {
|
|||
}
|
||||
|
||||
void func_80A454CC(EnGo2* this) {
|
||||
switch (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_CITY_ROLLING_BIG:
|
||||
case GORON_DMT_DC_ENTRANCE:
|
||||
case GORON_CITY_ENTRANCE:
|
||||
|
@ -1145,8 +1138,8 @@ void func_80A454CC(EnGo2* this) {
|
|||
}
|
||||
|
||||
f32 EnGo2_GetTargetXZSpeed(EnGo2* this) {
|
||||
f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f;
|
||||
s32 index = this->actor.params & 0x1F;
|
||||
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);
|
||||
|
||||
if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) &&
|
||||
(this->actor.xzDistToPlayer < 400.0f)) {
|
||||
|
@ -1159,7 +1152,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) {
|
|||
s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) {
|
||||
Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN];
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
if (EnGo2_IsWakingUp(this)) {
|
||||
Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW);
|
||||
Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG);
|
||||
|
@ -1169,9 +1162,11 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_FIRE_GENERIC || (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ||
|
||||
(this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ||
|
||||
(this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) {
|
||||
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) {
|
||||
return true;
|
||||
} else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) {
|
||||
return true;
|
||||
|
@ -1195,7 +1190,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_WakingUp(EnGo2* this) {
|
||||
f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f;
|
||||
f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f;
|
||||
s32 isTrue = true;
|
||||
|
||||
xyzDist = SQ(xyzDist);
|
||||
|
@ -1218,7 +1213,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_SelectGoronWakingUp(EnGo2* this) {
|
||||
switch (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_DMT_BOMB_FLOWER:
|
||||
this->isAwake = true;
|
||||
this->trackingMode = EnGo2_IsWakingUp(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE;
|
||||
|
@ -1273,7 +1268,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) {
|
|||
void EnGo2_SitDownAnimation(EnGo2* this) {
|
||||
if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronAnim_004930)) {
|
||||
if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) {
|
||||
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) {
|
||||
Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_DOWN);
|
||||
} else {
|
||||
func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60);
|
||||
|
@ -1291,7 +1286,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) {
|
|||
}
|
||||
|
||||
void EnGo2_GetDustData(EnGo2* this, s32 index2) {
|
||||
s32 index1 = (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ? 1 : 0;
|
||||
s32 index1 = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0;
|
||||
EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2];
|
||||
|
||||
EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep,
|
||||
|
@ -1299,7 +1294,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) {
|
|||
}
|
||||
|
||||
void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) {
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_0;
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10);
|
||||
this->skelAnime.playSpeed = -0.5f;
|
||||
|
@ -1316,13 +1311,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) {
|
|||
|
||||
void EnGo2_WakeUp(EnGo2* this, PlayState* play) {
|
||||
if (this->skelAnime.playSpeed == 0.0f) {
|
||||
if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != 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 ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN);
|
||||
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10);
|
||||
this->skelAnime.playSpeed = 0.5f;
|
||||
|
@ -1343,7 +1338,8 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
|
||||
if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ||
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) {
|
||||
this->collider.elem.acElemFlags = ACELEM_ON;
|
||||
this->actor.speed = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f;
|
||||
} else {
|
||||
|
@ -1359,8 +1355,9 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
|
|||
void EnGo2_StopRolling(EnGo2* this, PlayState* play) {
|
||||
EnBom* bomb;
|
||||
|
||||
if (((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) && ((this->actor.params & 0x1F) != GORON_CITY_LINK)) {
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_ROLLING_SMALL) {
|
||||
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) {
|
||||
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) {
|
||||
|
@ -1380,20 +1377,21 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) {
|
||||
if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// shaking curled up
|
||||
this->actor.world.pos.x += (play->state.frames & 1) ? 1.0f : -1.0f;
|
||||
if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) {
|
||||
if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) {
|
||||
if ((this->actor.params & 0x1F) != GORON_DMT_BOMB_FLOWER || this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER ||
|
||||
this->interactInfo.talkState != NPC_TALK_STATE_ACTION) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1406,7 +1404,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) {
|
||||
if ((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG ||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG ||
|
||||
(this->interactInfo.talkState != NPC_TALK_STATE_ACTION)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1417,7 +1415,8 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronFireGeneric(EnGo2* this) {
|
||||
if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC || this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC ||
|
||||
this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
return false;
|
||||
}
|
||||
this->actionFunc = EnGo2_GoronFireGenericAction;
|
||||
|
@ -1425,7 +1424,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) {
|
|||
}
|
||||
|
||||
s32 EnGo2_IsGoronLinkReversing(EnGo2* this) {
|
||||
if ((this->actor.params & 0x1F) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) ||
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) ||
|
||||
!EnGo2_IsWakingUp(this)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1448,7 +1447,7 @@ s32 EnGo2_IsRolling(EnGo2* this) {
|
|||
void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) {
|
||||
s32 animation = ARRAY_COUNT(sAnimationInfo);
|
||||
|
||||
if ((this->actor.params & 0x1F) == GORON_CITY_LINK) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) {
|
||||
if ((this->actor.textId == 0x3035 && this->unk_20C == 0) ||
|
||||
(this->actor.textId == 0x3036 && this->unk_20C == 0)) {
|
||||
if (this->skelAnime.animation != &gGoronAnim_000D5C) {
|
||||
|
@ -1501,7 +1500,8 @@ 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 &&
|
||||
(this->actor.params & 0x1F) == GORON_DMT_BIGGORON && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
|
||||
PARAMS_GET_S(this->actor.params, 0, 5) == 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);
|
||||
|
@ -1520,7 +1520,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 (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_FIRE_GENERIC:
|
||||
case GORON_DMT_BOMB_FLOWER:
|
||||
case GORON_DMT_ROLLING_SMALL:
|
||||
|
@ -1548,8 +1548,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||
this->waypoint = 0;
|
||||
this->unk_216 = this->actor.shape.rot.z;
|
||||
this->trackingMode = NPC_TRACKING_NONE;
|
||||
this->path = Path_GetByIndex(play, (this->actor.params & 0x3E0) >> 5, 0x1F);
|
||||
switch (this->actor.params & 0x1F) {
|
||||
this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 5, 5), 0x1F);
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_CITY_ENTRANCE:
|
||||
case GORON_CITY_ISLAND:
|
||||
case GORON_CITY_LOWEST_FLOOR:
|
||||
|
@ -1578,18 +1578,18 @@ void EnGo2_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
} else {
|
||||
CLEAR_INFTABLE(INFTABLE_10C);
|
||||
this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f);
|
||||
this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].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[this->actor.params & 0x1F].height * 0.6f);
|
||||
this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f);
|
||||
EnGo2_SetupRolling(this, play);
|
||||
break;
|
||||
case GORON_FIRE_GENERIC:
|
||||
if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) {
|
||||
if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
this->isAwake = true;
|
||||
|
@ -1625,12 +1625,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void EnGo2_CurledUp(EnGo2* this, PlayState* play) {
|
||||
u8 index = this->actor.params & 0x1F;
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
s16 height;
|
||||
s32 quakeIndex;
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3);
|
||||
Quake_SetSpeed(quakeIndex, -0x3CB0);
|
||||
Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0);
|
||||
|
@ -1653,13 +1653,13 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) {
|
|||
this->isAwake = false;
|
||||
EnGo2_WakeUp(this, play);
|
||||
}
|
||||
if (((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) {
|
||||
if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) {
|
||||
EnGo2_WakeUp(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
void func_80A46B40(EnGo2* this, PlayState* play) {
|
||||
u8 index = (this->actor.params & 0x1F);
|
||||
u8 index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
f32 height;
|
||||
|
||||
if (this->unk_211 == true) {
|
||||
|
@ -1676,7 +1676,7 @@ void func_80A46B40(EnGo2* this, PlayState* play) {
|
|||
}
|
||||
} else {
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) {
|
||||
if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) {
|
||||
this->actor.flags |= ACTOR_FLAG_0;
|
||||
}
|
||||
func_80A454CC(this);
|
||||
|
@ -1714,7 +1714,8 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) {
|
|||
void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) {
|
||||
f32 float1 = 1000.0f;
|
||||
|
||||
if (((this->actor.params & 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) &&
|
||||
if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL ||
|
||||
!(this->actor.xyzDistToPlayerSq > SQ(float1))) &&
|
||||
DECR(this->animTimer) == 0) {
|
||||
this->actionFunc = EnGo2_SlowRolling;
|
||||
this->actor.speed *= 0.5f; // slowdown
|
||||
|
@ -1735,7 +1736,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) {
|
|||
EnGo2_GetDustData(this, 3);
|
||||
}
|
||||
orientation = EnGo2_Orient(this, play);
|
||||
index = this->actor.params & 0x1F;
|
||||
index = PARAMS_GET_S(this->actor.params, 0, 5);
|
||||
if (index != GORON_CITY_LINK) {
|
||||
if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) {
|
||||
EnGo2_StopRolling(this, play);
|
||||
|
@ -1754,7 +1755,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) {
|
|||
if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) {
|
||||
EnGo2_GetDustData(this, 0);
|
||||
if (this->unk_59C == 0) {
|
||||
switch (this->actor.params & 0x1F) {
|
||||
switch (PARAMS_GET_S(this->actor.params, 0, 5)) {
|
||||
case GORON_CITY_LINK:
|
||||
this->goronState = 0;
|
||||
this->actionFunc = EnGo2_GoronLinkStopRolling;
|
||||
|
@ -1936,9 +1937,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) {
|
|||
} else {
|
||||
this->animTimer = 0;
|
||||
this->actor.speed = 0.0f;
|
||||
if ((((this->actor.params & 0xFC00) >> 0xA) != 1) && (((this->actor.params & 0xFC00) >> 0xA) != 2) &&
|
||||
(((this->actor.params & 0xFC00) >> 0xA) != 4) && (((this->actor.params & 0xFC00) >> 0xA) != 5) &&
|
||||
(((this->actor.params & 0xFC00) >> 0xA) != 9) && (((this->actor.params & 0xFC00) >> 0xA) != 11)) {
|
||||
if ((PARAMS_GET_S(this->actor.params, 10, 6) != 1) && (PARAMS_GET_S(this->actor.params, 10, 6) != 2) &&
|
||||
(PARAMS_GET_S(this->actor.params, 10, 6) != 4) && (PARAMS_GET_S(this->actor.params, 10, 6) != 5) &&
|
||||
(PARAMS_GET_S(this->actor.params, 10, 6) != 9) && (PARAMS_GET_S(this->actor.params, 10, 6) != 11)) {
|
||||
this->goronState++;
|
||||
}
|
||||
this->goronState++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue