Animation Cleanup: En_E* (#1331)

* begin E

* more cleanup

* limb index

* small cleanup

* format

* PR Review

* sLimbToBodyParts

* more bodypart cleanup
This commit is contained in:
engineer124 2023-08-11 11:26:29 +10:00 committed by GitHub
parent e1e30586c9
commit 2f1996a526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 480 additions and 324 deletions

View File

@ -124,8 +124,23 @@ static InitChainEntry sInitChain[] = {
* in the bodyPartsPos/Velocity arrays. An index of -1 indicates that the
* limb is not part of the bodyParts arrays.
*/
static s8 sLimbIndexToBodyPartsIndex[BUBBLE_LIMB_MAX] = {
-1, -1, -1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, 2, -1, 3,
static s8 sLimbToBodyParts[BUBBLE_LIMB_MAX] = {
-1, // BUBBLE_LIMB_NONE
-1, // BUBBLE_LIMB_ROOT
-1, // BUBBLE_LIMB_CRANIUM_ROOT
-1, // BUBBLE_LIMB_JAW_ROOT
0, // BUBBLE_LIMB_JAW
-1, // BUBBLE_LIMB_LEFT_WING_ROOT
-1, // BUBBLE_LIMB_LEFT_WING_WRAPPER
-1, // BUBBLE_LIMB_LEFT_WING_WEBBING_ROOT
1, // BUBBLE_LIMB_LEFT_WING_WEBBING
-1, // BUBBLE_LIMB_LEFT_WING_BONE
-1, // BUBBLE_LIMB_RIGHT_WING_ROOT
-1, // BUBBLE_LIMB_RIGHT_WING_WRAPPER
-1, // BUBBLE_LIMB_RIGHT_WING_WEBBING_ROOT
2, // BUBBLE_LIMB_RIGHT_WING_WEBBING
-1, // BUBBLE_LIMB_RIGHT_WING_BONE
3, // BUBBLE_LIMB_CRANIUM
};
/**
@ -637,32 +652,32 @@ void EnBb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
MtxF* currentMatrixState;
if (this->bodyPartDrawStatus == BB_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
if (sLimbIndexToBodyPartsIndex[limbIndex] == 0) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] == 0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
} else if (sLimbIndexToBodyPartsIndex[limbIndex] == 3) {
} else if (sLimbToBodyParts[limbIndex] == 3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
} else {
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
}
} else if (this->bodyPartDrawStatus > BB_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != -1) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == BUBBLE_LIMB_CRANIUM) {
this->bodyPartDrawStatus = BB_BODY_PART_DRAW_STATUS_BROKEN;
}
} else {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != -1) {
OPEN_DISPS(play->state.gfxCtx);
currentMatrixState = Matrix_GetCurrent();
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].x;
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].y;
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].z;
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].x;
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].y;
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].z;
Matrix_RotateZS(thisx->world.rot.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, this->limbDList);

View File

@ -153,8 +153,23 @@ static InitChainEntry sInitChain[] = {
* in the bodyPartsPos/Velocity arrays. An index of -1 indicates that the
* limb is not part of the bodyParts arrays.
*/
static s8 sLimbIndexToBodyPartsIndex[BUBBLE_LIMB_MAX] = {
-1, -1, -1, -1, 0, -1, -1, -1, 1, -1, -1, -1, -1, 2, -1, 3,
static s8 sLimbToBodyParts[BUBBLE_LIMB_MAX] = {
-1, // BUBBLE_LIMB_NONE
-1, // BUBBLE_LIMB_ROOT
-1, // BUBBLE_LIMB_CRANIUM_ROOT
-1, // BUBBLE_LIMB_JAW_ROOT
0, // BUBBLE_LIMB_JAW
-1, // BUBBLE_LIMB_LEFT_WING_ROOT
-1, // BUBBLE_LIMB_LEFT_WING_WRAPPER
-1, // BUBBLE_LIMB_LEFT_WING_WEBBING_ROOT
1, // BUBBLE_LIMB_LEFT_WING_WEBBING
-1, // BUBBLE_LIMB_LEFT_WING_BONE
-1, // BUBBLE_LIMB_RIGHT_WING_ROOT
-1, // BUBBLE_LIMB_RIGHT_WING_WRAPPER
-1, // BUBBLE_LIMB_RIGHT_WING_WEBBING_ROOT
2, // BUBBLE_LIMB_RIGHT_WING_WEBBING
-1, // BUBBLE_LIMB_RIGHT_WING_BONE
3, // BUBBLE_LIMB_CRANIUM
};
/**
@ -673,32 +688,32 @@ void EnBbfall_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
MtxF* currentMatrixState;
if (this->bodyPartDrawStatus == BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
if (sLimbIndexToBodyPartsIndex[limbIndex] == 0) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] == 0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
} else if (sLimbIndexToBodyPartsIndex[limbIndex] == 3) {
} else if (sLimbToBodyParts[limbIndex] == 3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
} else {
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
}
} else if (this->bodyPartDrawStatus > BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
Matrix_MultZero(&this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != -1) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == BUBBLE_LIMB_CRANIUM) {
this->bodyPartDrawStatus = BBFALL_BODY_PART_DRAW_STATUS_BROKEN;
}
} else {
if (sLimbIndexToBodyPartsIndex[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != -1) {
OPEN_DISPS(play->state.gfxCtx);
currentMatrixState = Matrix_GetCurrent();
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].x;
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].y;
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbIndexToBodyPartsIndex[limbIndex]].z;
currentMatrixState->mf[3][0] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].x;
currentMatrixState->mf[3][1] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].y;
currentMatrixState->mf[3][2] = this->bodyPartsPos[sLimbToBodyParts[limbIndex]].z;
Matrix_RotateZS(thisx->world.rot.z, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, this->limbDList);

View File

@ -627,26 +627,47 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
return false;
}
static s8 sLimbToBodyParts[BIGOKUTA_LIMB_MAX] = {
-1, // BIGOKUTA_LIMB_NONE
-1, // BIGOKUTA_LIMB_BODY
-1, // BIGOKUTA_LIMB_RIGHT_FRONT_ARM_BASE
0, // BIGOKUTA_LIMB_RIGHT_FRONT_ARM_END
-1, // BIGOKUTA_LIMB_LEFT_FRONT_ARM_BASE
1, // BIGOKUTA_LIMB_LEFT_FRONT_ARM_END
-1, // BIGOKUTA_LIMB_RIGHT_BACK_ARM_BASE
2, // BIGOKUTA_LIMB_RIGHT_BACK_ARM_END
-1, // BIGOKUTA_LIMB_LEFT_BACK_ARM_BASE
3, // BIGOKUTA_LIMB_LEFT_BACK_ARM_END
8, // BIGOKUTA_LIMB_HEAD
4, // BIGOKUTA_LIMB_LEFT_TENTACLE_BASE
-1, // BIGOKUTA_LIMB_LEFT_TENTACLE_TIP
5, // BIGOKUTA_LIMB_RIGHT_TENTACLE_BASE
-1, // BIGOKUTA_LIMB_RIGHT_TENTACLE_TIP
-1, // BIGOKUTA_LIMB_LEFT_WEAK_POINT
-1, // BIGOKUTA_LIMB_RIGHT_WEAK_POINT
-1, // BIGOKUTA_LIMB_CENTER_SNOUT
6, // BIGOKUTA_LIMB_RIGHT_SNOUT
7, // BIGOKUTA_LIMB_LEFT_SNOUT
};
static Vec3f D_80AC45D0[] = {
{ 0.0f, 2000.0f, 1000.0f }, { 0.0f, 2000.0f, -2000.0f }, { 1700.0f, 700.0f, -600.0f },
{ -1700.0f, 700.0f, -600.0f }, { 0.0f, 500.0f, -2500.0f },
};
void EnBigokuta_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static s8 D_80AC45BC[BIGOKUTA_LIMB_MAX] = {
-1, -1, -1, 0, -1, 1, -1, 2, -1, 3, 8, 4, -1, 5, -1, -1, -1, -1, 6, 7,
};
static Vec3f D_80AC45D0[] = {
{ 0.0f, 2000.0f, 1000.0f }, { 0.0f, 2000.0f, -2000.0f }, { 1700.0f, 700.0f, -600.0f },
{ -1700.0f, 700.0f, -600.0f }, { 0.0f, 500.0f, -2500.0f },
};
EnBigokuta* this = THIS;
s32 i;
s8 limbPosIndex = D_80AC45BC[limbIndex];
s8 bodyPartIndex = sLimbToBodyParts[limbIndex];
if (limbPosIndex != -1) {
if (limbPosIndex < 6) {
Matrix_MultVecX(800.0f, &this->limbPos[limbPosIndex]);
} else if (limbPosIndex < 8) {
Matrix_MultZero(&this->limbPos[limbPosIndex]);
if (bodyPartIndex != -1) {
if (bodyPartIndex < 6) {
Matrix_MultVecX(800.0f, &this->limbPos[bodyPartIndex]);
} else if (bodyPartIndex < 8) {
Matrix_MultZero(&this->limbPos[bodyPartIndex]);
} else {
for (i = 0; i < ARRAY_COUNT(D_80AC45D0); i++) {
Matrix_MultVec3f(&D_80AC45D0[i], &this->limbPos[limbPosIndex + i]);
Matrix_MultVec3f(&D_80AC45D0[i], &this->limbPos[bodyPartIndex + i]);
}
}
}

View File

@ -160,9 +160,17 @@ static InitChainEntry sInitChain[] = {
// used in the burning death actionfunc
static Vec3f D_80B6506C = { 0.0f, 3.0f, 0.0f };
// bytes per limb, used in draw func? bit over my head
static u8 D_80B65078[BIG_POE_LIMB_MAX] = {
-1, 4, -1, 0, -1, 1, -1, 2, 5, 3,
static u8 sLimbToBodyParts[BIG_POE_LIMB_MAX] = {
-1, // BIG_POE_LIMB_NONE
4, // BIG_POE_LIMB_FACE
-1, // BIG_POE_LIMB_LEFT_UPPER_ARM
0, // BIG_POE_LIMB_LEFT_FOREARM
-1, // BIG_POE_LIMB_RIGHT_UPPER_ARM
1, // BIG_POE_LIMB_RIGHT_FOREARM
-1, // BIG_POE_LIMB_RIGHT_HAND
2, // BIG_POE_LIMB_LANTERN
5, // BIG_POE_LIMB_HAT_AND_CLOAK
3, // BIG_POE_LIMB_LOWER_ROBE
};
// used in limbdraw
@ -1232,7 +1240,7 @@ s32 EnBigpo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
void EnBigpo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
EnBigpo* this = THIS;
s8 limbByte;
s8 bodyPartIndex;
Vec3f* v1ptr; // todo: figure out better names
Vec3f* v2ptr;
Vec3f unusedVec;
@ -1258,20 +1266,20 @@ void EnBigpo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro
Matrix_Get(&this->drawMtxF);
}
limbByte = D_80B65078[limbIndex];
if (limbByte != -1) {
if (limbByte < 3) {
Matrix_MultZero(&this->limbPos[limbByte]);
} else if (limbByte == 3) {
Matrix_MultVecX(3000.0f, &this->limbPos[limbByte]);
} else if (limbByte == 4) {
Matrix_MultVecY(-2000.0f, &this->limbPos[limbByte]);
bodyPartIndex = sLimbToBodyParts[limbIndex];
if (bodyPartIndex != -1) {
if (bodyPartIndex < 3) {
Matrix_MultZero(&this->limbPos[bodyPartIndex]);
} else if (bodyPartIndex == 3) {
Matrix_MultVecX(3000.0f, &this->limbPos[bodyPartIndex]);
} else if (bodyPartIndex == 4) {
Matrix_MultVecY(-2000.0f, &this->limbPos[bodyPartIndex]);
} else {
v2ptr = &this->limbPos[limbByte + 1];
v2ptr = &this->limbPos[bodyPartIndex + 1];
v1ptr = D_80B65084;
Matrix_MultVecX(-4000.0f, &this->limbPos[limbByte]);
Matrix_MultVecX(-4000.0f, &this->limbPos[bodyPartIndex]);
for (i = limbByte + 1; i < ARRAY_COUNT(this->limbPos); i++) {
for (i = bodyPartIndex + 1; i < ARRAY_COUNT(this->limbPos); i++) {
Matrix_MultVec3f(v1ptr, v2ptr);
v2ptr++;
v1ptr++;

View File

@ -3033,26 +3033,37 @@ void EnBigslime_DrawBigslime(Actor* thisx, PlayState* play) {
EnBigslime_DrawGekko(&this->actor, play);
}
static s8 sLimbToBodyParts[GEKKO_LIMB_MAX] = {
-1, // GEKKO_LIMB_NONE
-1, // GEKKO_LIMB_ROOT
0, // GEKKO_LIMB_WAIST
-1, // GEKKO_LIMB_LEFT_THIGH
1, // GEKKO_LIMB_LEFT_SHIN
-1, // GEKKO_LIMB_LEFT_ANKLE
2, // GEKKO_LIMB_LEFT_FOOT
-1, // GEKKO_LIMB_RIGHT_THIGH
3, // GEKKO_LIMB_RIGHT_SHIN
-1, // GEKKO_LIMB_RIGHT_ANKLE
4, // GEKKO_LIMB_RIGHT_FOOT
-1, // GEKKO_LIMB_TORSO
5, // GEKKO_LIMB_LEFT_UPPER_ARM
6, // GEKKO_LIMB_LEFT_FOREARM
-1, // GEKKO_LIMB_LEFT_WRIST
7, // GEKKO_LIMB_LEFT_HAND
8, // GEKKO_LIMB_RIGHT_UPPER_ARM
9, // GEKKO_LIMB_RIGHT_FOREARM
-1, // GEKKO_LIMB_RIGHT_WRIST
10, // GEKKO_LIMB_RIGHT_HAND
-1, // GEKKO_LIMB_HEAD
11, // GEKKO_LIMB_JAW
-1, // GEKKO_LIMB_LEFT_EYE
-1, // GEKKO_LIMB_RIGHT_EYE
};
// Some kind of offset for the position of the Gekkos right foot
static Vec3f sRightFootOffsetRef = { 1500.0f, 2200.0f, 0.0f };
void EnBigslime_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
/* value -1: Limb Not used
* value 0: GEKKO_LIMB_WAIST
* value 1: GEKKO_LIMB_L_SHIN
* value 2: GEKKO_LIMB_L_FOOT
* value 3: GEKKO_LIMB_R_SHIN
* value 4: GEKKO_LIMB_R_FOOT
* value 5: GEKKO_LIMB_L_UPPER_ARM
* value 6: GEKKO_LIMB_L_FOREARM
* value 7: GEKKO_LIMB_L_HAND
* value 8: GEKKO_LIMB_R_UPPER_ARM
* value 9: GEKKO_LIMB_R_FOREARM
* value 10: GEKKO_LIMB_R_HAND
* value 11: GEKKO_LIMB_JAW
*/
static s8 limbPosIndex[] = {
-1, -1, 0, -1, 1, -1, 2, -1, 3, -1, 4, -1, 5, 6, -1, 7, 8, 9, -1, 10, -1, 11, -1, -1,
};
// Some kind of offset for the position of the Gekkos right foot
static Vec3f rightFootOffsetRef = { 1500.0f, 2200.0f, 0.0f };
EnBigslime* this = THIS;
Vec3f rightFootOffset;
@ -3061,12 +3072,12 @@ void EnBigslime_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
this->actor.focus.rot.y = this->gekkoRot.y;
}
if (limbPosIndex[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[limbPosIndex[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == GEKKO_LIMB_RIGHT_ANKLE) {
Matrix_MultVec3f(&rightFootOffsetRef, &rightFootOffset);
Matrix_MultVec3f(&sRightFootOffsetRef, &rightFootOffset);
this->gekkoCollider.dim.pos.y = rightFootOffset.y;
}
}

View File

@ -195,24 +195,24 @@ void EnBombal_Draw(Actor* thisx, PlayState* play) {
void EnBombal_InitEffects(EnBombal* this, Vec3f* pos, s16 fadeDelay) {
s16 i;
EnBombalEffect* sPtr = this->effects;
EnBombalEffect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (!sPtr->isEnabled) {
sPtr->isEnabled = true;
sPtr->pos = *pos;
sPtr->alphaFadeDelay = fadeDelay;
sPtr->alpha = 255;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (!effect->isEnabled) {
effect->isEnabled = true;
effect->pos = *pos;
effect->alphaFadeDelay = fadeDelay;
effect->alpha = 255;
sPtr->accel.x = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->accel.y = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->accel.z = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.x = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.y = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.z = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->velocity.x = Rand_ZeroOne() - 0.5f;
sPtr->velocity.y = Rand_ZeroOne() - 0.5f;
sPtr->velocity.z = Rand_ZeroOne() - 0.5f;
effect->velocity.x = Rand_ZeroOne() - 0.5f;
effect->velocity.y = Rand_ZeroOne() - 0.5f;
effect->velocity.z = Rand_ZeroOne() - 0.5f;
sPtr->scale = (Rand_ZeroFloat(1.0f) * 0.5f) + 2.0f;
effect->scale = (Rand_ZeroFloat(1.0f) * 0.5f) + 2.0f;
return;
}
}
@ -220,23 +220,23 @@ void EnBombal_InitEffects(EnBombal* this, Vec3f* pos, s16 fadeDelay) {
void EnBombal_UpdateEffects(EnBombal* this, PlayState* play) {
s32 i;
EnBombalEffect* sPtr = this->effects;
EnBombalEffect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (sPtr->isEnabled) {
sPtr->pos.x += sPtr->velocity.x;
sPtr->pos.y += sPtr->velocity.y;
sPtr->pos.z += sPtr->velocity.z;
sPtr->velocity.x += sPtr->accel.x;
sPtr->velocity.y += sPtr->accel.y;
sPtr->velocity.z += sPtr->accel.z;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
effect->pos.x += effect->velocity.x;
effect->pos.y += effect->velocity.y;
effect->pos.z += effect->velocity.z;
effect->velocity.x += effect->accel.x;
effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z;
if (sPtr->alphaFadeDelay != 0) {
sPtr->alphaFadeDelay--;
if (effect->alphaFadeDelay != 0) {
effect->alphaFadeDelay--;
} else {
sPtr->alpha -= 10;
if (sPtr->alpha < 10) {
sPtr->isEnabled = 0;
effect->alpha -= 10;
if (effect->alpha < 10) {
effect->isEnabled = 0;
}
}
}
@ -246,17 +246,17 @@ void EnBombal_UpdateEffects(EnBombal* this, PlayState* play) {
void EnBombal_DrawEffects(EnBombal* this, PlayState* play) {
s16 i;
GraphicsContext* gfxCtx = play->state.gfxCtx;
EnBombalEffect* sPtr = this->effects;
EnBombalEffect* effect = this->effects;
OPEN_DISPS(gfxCtx);
Gfx_SetupDL25_Opa(gfxCtx);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (sPtr->isEnabled != 0) {
Matrix_Translate(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY);
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);
@ -267,7 +267,7 @@ void EnBombal_DrawEffects(EnBombal* this, PlayState* play) {
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, effect->alpha);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZF(DEG_TO_RAD(play->state.frames * 20.0f), MTXMODE_APPLY);

View File

@ -41,25 +41,6 @@ typedef enum {
/* 3 */ EYEGORE_EFFECT_DEBRIS
} EnEgolEffectType;
typedef enum {
/* 0 */ EYEGORE_ANIM_STAND,
/* 1 */ EYEGORE_ANIM_WALK,
/* 2 */ EYEGORE_ANIM_SLAM,
/* 3 */ EYEGORE_ANIM_SLAM_WAIT,
/* 4 */ EYEGORE_ANIM_SLAM_END,
/* 5 */ EYEGORE_ANIM_DAMAGED,
/* 6 */ EYEGORE_ANIM_DEATH,
/* 7 */ EYEGORE_ANIM_LASER,
/* 8 */ EYEGORE_ANIM_LASER_END, // unused
/* 9 */ EYEGORE_ANIM_STUNNED,
/* 10 */ EYEGORE_ANIM_STUN_END,
/* 11 */ EYEGORE_ANIM_RETREAT,
/* 12 */ EYEGORE_ANIM_SIT,
/* 13 */ EYEGORE_ANIM_LEFT_PUNCH,
/* 14 */ EYEGORE_ANIM_RIGHT_PUNCH,
/* 15 */ EYEGORE_ANIM_MAX
} EnEgolAnimation;
typedef enum {
/* 0 */ EYEGORE_LASER_OFF,
/* 1 */ EYEGORE_LASER_START,
@ -306,23 +287,66 @@ ActorInit En_Egol_InitVars = {
(ActorFunc)EnEgol_Draw,
};
void EnEgol_ChangeAnim(EnEgol* this, s32 animation) {
static AnimationHeader* sAnimations[EYEGORE_ANIM_MAX] = {
&gEyegoreStandAnim, &gEyegoreWalkAnim, &gEyegoreSlamAnim,
&gEyegoreSlamWaitAnim, &gEyegoreSlamEndAnim, &gEyegoreDamagedAnim,
&gEyegoreDeathAnim, &gEyegoreLaserAnim, &gEyegoreUnusedLaserEndAnim,
&gEyegoreStunnedAnim, &gEyegoreStunEndAnim, &gEyegoreRetreatAnim,
&gEyegoreSitAnim, &gEyegoreLeftPunchAnim, &gEyegoreRightPunchAnim,
};
static u8 sAnimModes[EYEGORE_ANIM_MAX] = {
ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE,
ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE,
ANIMMODE_ONCE, ANIMMODE_LOOP, ANIMMODE_ONCE, ANIMMODE_ONCE, ANIMMODE_ONCE,
};
this->animation = animation;
this->animEndFrame = Animation_GetLastFrame(sAnimations[this->animation]);
Animation_Change(&this->skelAnime, sAnimations[this->animation], 1.0f, 0.0f, this->animEndFrame,
sAnimModes[this->animation], 0.0f);
typedef enum {
/* 0 */ EYEGORE_ANIM_STAND,
/* 1 */ EYEGORE_ANIM_WALK,
/* 2 */ EYEGORE_ANIM_SLAM,
/* 3 */ EYEGORE_ANIM_SLAM_WAIT,
/* 4 */ EYEGORE_ANIM_SLAM_END,
/* 5 */ EYEGORE_ANIM_DAMAGED,
/* 6 */ EYEGORE_ANIM_DEATH,
/* 7 */ EYEGORE_ANIM_LASER,
/* 8 */ EYEGORE_ANIM_LASER_END, // unused
/* 9 */ EYEGORE_ANIM_STUNNED,
/* 10 */ EYEGORE_ANIM_STUN_END,
/* 11 */ EYEGORE_ANIM_RETREAT,
/* 12 */ EYEGORE_ANIM_SIT,
/* 13 */ EYEGORE_ANIM_LEFT_PUNCH,
/* 14 */ EYEGORE_ANIM_RIGHT_PUNCH,
/* 15 */ EYEGORE_ANIM_MAX
} EnEgolAnimation;
static AnimationHeader* sAnimations[EYEGORE_ANIM_MAX] = {
&gEyegoreStandAnim, // EYEGORE_ANIM_STAND
&gEyegoreWalkAnim, // EYEGORE_ANIM_WALK
&gEyegoreSlamAnim, // EYEGORE_ANIM_SLAM
&gEyegoreSlamWaitAnim, // EYEGORE_ANIM_SLAM_WAIT
&gEyegoreSlamEndAnim, // EYEGORE_ANIM_SLAM_END
&gEyegoreDamagedAnim, // EYEGORE_ANIM_DAMAGED
&gEyegoreDeathAnim, // EYEGORE_ANIM_DEATH
&gEyegoreLaserAnim, // EYEGORE_ANIM_LASER
&gEyegoreUnusedLaserEndAnim, // EYEGORE_ANIM_LASER_END
&gEyegoreStunnedAnim, // EYEGORE_ANIM_STUNNED
&gEyegoreStunEndAnim, // EYEGORE_ANIM_STUN_END
&gEyegoreRetreatAnim, // EYEGORE_ANIM_RETREAT
&gEyegoreSitAnim, // EYEGORE_ANIM_SIT
&gEyegoreLeftPunchAnim, // EYEGORE_ANIM_LEFT_PUNCH
&gEyegoreRightPunchAnim, // EYEGORE_ANIM_RIGHT_PUNCH
};
static u8 sAnimationModes[EYEGORE_ANIM_MAX] = {
ANIMMODE_ONCE, // EYEGORE_ANIM_STAND
ANIMMODE_LOOP, // EYEGORE_ANIM_WALK
ANIMMODE_ONCE, // EYEGORE_ANIM_SLAM
ANIMMODE_ONCE, // EYEGORE_ANIM_SLAM_WAIT
ANIMMODE_ONCE, // EYEGORE_ANIM_SLAM_END
ANIMMODE_ONCE, // EYEGORE_ANIM_DAMAGED
ANIMMODE_ONCE, // EYEGORE_ANIM_DEATH
ANIMMODE_ONCE, // EYEGORE_ANIM_LASER
ANIMMODE_ONCE, // EYEGORE_ANIM_LASER_END
ANIMMODE_ONCE, // EYEGORE_ANIM_STUNNED
ANIMMODE_ONCE, // EYEGORE_ANIM_STUN_END
ANIMMODE_LOOP, // EYEGORE_ANIM_RETREAT
ANIMMODE_ONCE, // EYEGORE_ANIM_SIT
ANIMMODE_ONCE, // EYEGORE_ANIM_LEFT_PUNCH
ANIMMODE_ONCE, // EYEGORE_ANIM_RIGHT_PUNCH
};
void EnEgol_ChangeAnim(EnEgol* this, s32 animIndex) {
this->animIndex = animIndex;
this->animEndFrame = Animation_GetLastFrame(sAnimations[this->animIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.0f, this->animEndFrame,
sAnimationModes[this->animIndex], 0.0f);
}
void EnEgol_FootstepEffects(EnEgol* this, PlayState* play, f32 leftFootFrame, f32 rightFootFrame) {
@ -1196,10 +1220,10 @@ void EnEgol_Update(Actor* thisx, PlayState* play) {
if ((ABS_ALT(angleToFacing) > 0x1888) && (ABS_ALT(angleBehind) > 0x2000) &&
(this->actor.xzDistToPlayer < 100.0f)) {
if (angleToFacing < 0) {
if (this->animation != EYEGORE_ANIM_LEFT_PUNCH) {
if (this->animIndex != EYEGORE_ANIM_LEFT_PUNCH) {
EnEgol_ChangeAnim(this, EYEGORE_ANIM_LEFT_PUNCH);
}
} else if (this->animation != EYEGORE_ANIM_RIGHT_PUNCH) {
} else if (this->animIndex != EYEGORE_ANIM_RIGHT_PUNCH) {
EnEgol_ChangeAnim(this, EYEGORE_ANIM_RIGHT_PUNCH);
}
this->chargingLaser = false;

View File

@ -46,7 +46,7 @@ typedef struct EnEgol {
/* 0x02C0 */ Vec3f limbPos[12];
/* 0x0350 */ s16 limbPosIndex;
/* 0x0352 */ s16 pathIndex;
/* 0x0354 */ s32 animation;
/* 0x0354 */ s32 animIndex;
/* 0x0358 */ u8 isRetreating;
/* 0x035C */ f32 animEndFrame;
/* 0x0360 */ f32 wakeupRange;

View File

@ -5,7 +5,6 @@
*/
#include "z_en_elf.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000)
@ -324,7 +323,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) {
Actor_ProcessInitChain(thisx, sInitChain);
SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable,
this->morphTable, 7);
this->morphTable, FAIRY_LIMB_MAX);
ActorShape_Init(&thisx->shape, 0.0f, NULL, 15.0f);
thisx->shape.shadowAlpha = 255;
@ -1557,7 +1556,7 @@ s32 EnElf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
Vec3f sp34;
f32 scale;
if (limbIndex == 6) {
if (limbIndex == FAIRY_LIMB_6) {
scale = ((Math_SinS(this->timer * 4096) * 0.1f) + 1.0f) * 0.012f;
if (this->fairyFlags & 0x200) {
scale *= 2.0f;
@ -1569,8 +1568,11 @@ s32 EnElf_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
}
//! @note: `limbIndex` extends past `FAIRY_LIMB_MAX`.
//! This code was copied from OoT despite the number of limbs decreasing.
//! In OoT, this was intented to not draw wings for big fairies
if ((this->fairyFlags & 0x200) &&
((limbIndex == 4) || (limbIndex == 7) || (limbIndex == 11) || (limbIndex == 14))) {
((limbIndex == FAIRY_LIMB_4) || (limbIndex == 7) || (limbIndex == 11) || (limbIndex == 14))) {
*dList = NULL;
}
return false;

View File

@ -2,6 +2,7 @@
#define Z_EN_ELF_H
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
struct EnElf;
@ -31,8 +32,8 @@ typedef enum {
typedef struct EnElf {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[7];
/* 0x1B2 */ Vec3s morphTable[7];
/* 0x188 */ Vec3s jointTable[FAIRY_LIMB_MAX];
/* 0x1B2 */ Vec3s morphTable[FAIRY_LIMB_MAX];
/* 0x1DC */ Color_RGBAf innerColor;
/* 0x1EC */ Color_RGBAf outerColor;
/* 0x1FC */ LightInfo lightInfoGlow;

View File

@ -119,6 +119,9 @@ void EnElfgrp_Init(Actor* thisx, PlayState* play) {
this->unk_14A |= 0x10;
}
break;
default:
break;
}
} else if (func_80A39BD0(play, this->unk_147)) {
this->actionFunc = func_80A3A7FC;
@ -409,6 +412,9 @@ void func_80A3A274(EnElfgrp* this, PlayState* play) {
this->actionFunc = func_80A3A210;
this->unk_144 = 90;
break;
default:
break;
}
}
}

View File

@ -164,7 +164,7 @@ void EnElforg_Destroy(Actor* thisx, PlayState* play) {
void EnElforg_SpawnSparkles(EnElforg* this, PlayState* play, s32 life) {
static Vec3f sVelocity = { 0.0f, -0.05f, 0.0f };
static Vec3f sAcceleration = { 0.0f, -0.025f, 0.0f };
static Vec3f sAccel = { 0.0f, -0.025f, 0.0f };
static Color_RGBA8 sPrimColors[] = {
{ 255, 235, 220, 255 }, { 255, 220, 220, 255 }, { 220, 255, 220, 255 },
{ 220, 220, 255, 255 }, { 255, 255, 200, 255 },
@ -182,8 +182,8 @@ void EnElforg_SpawnSparkles(EnElforg* this, PlayState* play, s32 life) {
index = (this->area < STRAY_FAIRY_AREA_CLOCK_TOWN || this->area >= STRAY_FAIRY_AREA_MAX)
? STRAY_FAIRY_AREA_CLOCK_TOWN
: this->area;
EffectSsKirakira_SpawnDispersed(play, &pos, &sVelocity, &sAcceleration, &sPrimColors[index], &sEnvColors[index],
1000, life);
EffectSsKirakira_SpawnDispersed(play, &pos, &sVelocity, &sAccel, &sPrimColors[index], &sEnvColors[index], 1000,
life);
}
void EnElforg_ApproachTargetYPosition(EnElforg* this, Vec3f* targetPos) {

View File

@ -142,6 +142,9 @@ void EnEncount1_SpawnActor(EnEncount1* this, PlayState* play) {
Actor_Kill(&this->actor);
}
break;
default:
break;
}
actorId = sActorIds[this->type];

View File

@ -21,7 +21,7 @@ void EnEncount2_Draw(Actor* thisx, PlayState* play);
void EnEncount2_Idle(EnEncount2* this, PlayState* play);
void EnEncount2_Popped(EnEncount2* this, PlayState* play);
void EnEncount2_Die(EnEncount2* this, PlayState* play);
void EnEncount2_SetIdle(EnEncount2* this);
void EnEncount2_SetupIdle(EnEncount2* this);
void EnEncount2_InitEffects(EnEncount2* this, Vec3f* pos, s16 fadeDelay);
void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play);
void EnEncount2_DrawEffects(EnEncount2* this, PlayState* play);
@ -121,19 +121,19 @@ void EnEncount2_Init(Actor* thisx, PlayState* play) {
this->switchFlag = -1;
}
if ((this->switchFlag >= 0) && (Flags_GetSwitch(play, this->switchFlag))) {
if ((this->switchFlag >= 0) && Flags_GetSwitch(play, this->switchFlag)) {
Actor_Kill(&this->dyna.actor);
return;
}
this->collider.elements->dim.modelSphere.radius = 0x39;
this->collider.elements->dim.modelSphere.radius = 57;
this->collider.elements->dim.scale = 1.0f;
this->collider.elements->dim.modelSphere.center.x = 0;
this->collider.elements->dim.modelSphere.center.y = -4;
this->collider.elements->dim.modelSphere.center.z = 0;
this->dyna.actor.colChkInfo.damageTable = &sDamageTable;
EnEncount2_SetIdle(this);
EnEncount2_SetupIdle(this);
}
void EnEncount2_Destroy(Actor* thisx, PlayState* play) {
@ -143,7 +143,7 @@ void EnEncount2_Destroy(Actor* thisx, PlayState* play) {
Collider_DestroyJntSph(play, &this->collider);
}
void EnEncount2_SetIdle(EnEncount2* this) {
void EnEncount2_SetupIdle(EnEncount2* this) {
this->isPopped = false;
this->actionFunc = EnEncount2_Idle;
}
@ -152,6 +152,7 @@ void EnEncount2_Idle(EnEncount2* this, PlayState* play) {
this->oscillationAngle += 1500.0f;
this->dyna.actor.velocity.y = Math_SinS(this->oscillationAngle);
Math_ApproachF(&this->scale, 0.1f, 0.3f, 0.01f);
if ((this->collider.base.acFlags & AC_HIT) && (this->dyna.actor.colChkInfo.damageEffect == 0xE)) {
this->dyna.actor.colChkInfo.health = 0;
this->isPopped = true;
@ -217,24 +218,24 @@ void EnEncount2_Draw(Actor* thisx, PlayState* play) {
void EnEncount2_InitEffects(EnEncount2* this, Vec3f* pos, s16 fadeDelay) {
s16 i;
EnEncount2Effect* sPtr = this->effects;
EnEncount2Effect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (!sPtr->isEnabled) {
sPtr->isEnabled = true;
sPtr->pos = *pos;
sPtr->alphaFadeDelay = fadeDelay;
sPtr->alpha = 255;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (!effect->isEnabled) {
effect->isEnabled = true;
effect->pos = *pos;
effect->alphaFadeDelay = fadeDelay;
effect->alpha = 255;
sPtr->accel.x = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->accel.y = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->accel.z = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.x = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.y = (Rand_ZeroOne() - 0.5f) * 10.0f;
effect->accel.z = (Rand_ZeroOne() - 0.5f) * 10.0f;
sPtr->velocity.x = Rand_ZeroOne() - 0.5f;
sPtr->velocity.y = Rand_ZeroOne() - 0.5f;
sPtr->velocity.z = Rand_ZeroOne() - 0.5f;
effect->velocity.x = Rand_ZeroOne() - 0.5f;
effect->velocity.y = Rand_ZeroOne() - 0.5f;
effect->velocity.z = Rand_ZeroOne() - 0.5f;
sPtr->scale = (Rand_ZeroFloat(1.0f) * 0.5f) + 2.0f;
effect->scale = (Rand_ZeroFloat(1.0f) * 0.5f) + 2.0f;
return;
}
}
@ -242,23 +243,23 @@ void EnEncount2_InitEffects(EnEncount2* this, Vec3f* pos, s16 fadeDelay) {
void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play) {
s32 i;
EnEncount2Effect* sPtr = this->effects;
EnEncount2Effect* effect = this->effects;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (sPtr->isEnabled) {
sPtr->pos.x += sPtr->velocity.x;
sPtr->pos.y += sPtr->velocity.y;
sPtr->pos.z += sPtr->velocity.z;
sPtr->velocity.x += sPtr->accel.x;
sPtr->velocity.y += sPtr->accel.y;
sPtr->velocity.z += sPtr->accel.z;
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
effect->pos.x += effect->velocity.x;
effect->pos.y += effect->velocity.y;
effect->pos.z += effect->velocity.z;
effect->velocity.x += effect->accel.x;
effect->velocity.y += effect->accel.y;
effect->velocity.z += effect->accel.z;
if (sPtr->alphaFadeDelay != 0) {
sPtr->alphaFadeDelay--;
if (effect->alphaFadeDelay != 0) {
effect->alphaFadeDelay--;
} else {
sPtr->alpha -= 10;
if (sPtr->alpha < 10) {
sPtr->isEnabled = 0;
effect->alpha -= 10;
if (effect->alpha < 10) {
effect->isEnabled = 0;
}
}
}
@ -267,24 +268,24 @@ void EnEncount2_UpdateEffects(EnEncount2* this, PlayState* play) {
void EnEncount2_DrawEffects(EnEncount2* this, PlayState* play) {
s16 i;
EnEncount2Effect* sPtr;
EnEncount2Effect* effect;
GraphicsContext* gfxCtx = play->state.gfxCtx;
OPEN_DISPS(gfxCtx);
sPtr = this->effects;
effect = this->effects;
Gfx_SetupDL25_Opa(gfxCtx);
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
for (i = 0; i < ARRAY_COUNT(this->effects); i++, sPtr++) {
if (sPtr->isEnabled) {
Matrix_Translate(sPtr->pos.x, sPtr->pos.y, sPtr->pos.z, MTXMODE_NEW);
Matrix_Scale(sPtr->scale, sPtr->scale, sPtr->scale, MTXMODE_APPLY);
for (i = 0; i < ARRAY_COUNT(this->effects); i++, effect++) {
if (effect->isEnabled) {
Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW);
Matrix_Scale(effect->scale, effect->scale, effect->scale, MTXMODE_APPLY);
POLY_XLU_DISP = Gfx_SetupDL(POLY_XLU_DISP, SETUPDL_20);
gSPSegment(POLY_XLU_DISP++, 0x08, Lib_SegmentedToVirtual(gSun1Tex));
gSPDisplayList(POLY_XLU_DISP++, gSunSparkleMaterialDL);
gDPPipeSync(POLY_XLU_DISP++);
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, sPtr->alpha);
gDPSetEnvColor(POLY_XLU_DISP++, 250, 180, 255, effect->alpha);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
Matrix_RotateZF(DEG_TO_RAD(play->state.frames * 20.0f), MTXMODE_APPLY);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

View File

@ -72,11 +72,12 @@ void func_809C3FD8(EnEncount4* this, PlayState* play) {
while (actor != NULL) {
if (actor->id != ACTOR_EN_BSB) {
actor = actor->next;
} else {
this->captainKeeta = (EnBsb*)actor;
this->actionFunc = func_809C4078;
break;
continue;
}
this->captainKeeta = (EnBsb*)actor;
this->actionFunc = func_809C4078;
break;
}
}
}
@ -145,15 +146,16 @@ void func_809C42A8(EnEncount4* this, PlayState* play) {
if ((this->captainKeeta->actor.id != ACTOR_EN_BSB) || (captainKeeta->actor.update == NULL)) {
Actor_Kill(&this->actor);
}
return;
} else if (this->unk_14E >= 2) {
}
if (this->unk_14E >= 2) {
this->timer = 100;
this->actionFunc = func_809C464C;
return;
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_85_40) || (this->unk_14C >= 2) ||
(this->actor.xzDistToPlayer > 240.0f)) {
}
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_85_40) || (this->unk_14C >= 2) || (this->actor.xzDistToPlayer > 240.0f)) {
return;
}
@ -167,7 +169,7 @@ void func_809C42A8(EnEncount4* this, PlayState* play) {
}
pos.y = yIntersect;
yRot = (s32)Rand_ZeroFloat(512.0f) + this->actor.world.rot.y + 0x3800;
yRot = (s32)Rand_ZeroFloat(0x200) + this->actor.world.rot.y + 0x3800;
if (this->unk_14C != 0) {
yRot += 0x8000;
}

View File

@ -5,7 +5,6 @@
*/
#include "z_en_ending_hero.h"
#include "objects/object_dt/object_dt.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -16,8 +15,8 @@ void EnEndingHero_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero_Update(Actor* thisx, PlayState* play);
void EnEndingHero_Draw(Actor* thisx, PlayState* play);
void func_80C1E748(EnEndingHero* this);
void func_80C1E764(EnEndingHero* this, PlayState* play);
void EnEndingHero1_SetupIdle(EnEndingHero* this);
void EnEndingHero1_Idle(EnEndingHero* this, PlayState* play);
ActorInit En_Ending_Hero_InitVars = {
ACTOR_EN_ENDING_HERO,
@ -39,20 +38,20 @@ void EnEndingHero_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, &object_dt_Skel_00B0CC, &object_dt_Anim_000BE0, this->jointTable,
this->morphTable, 15);
this->morphTable, OBJECT_DT_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C1E748(this);
EnEndingHero1_SetupIdle(this);
}
void EnEndingHero_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C1E748(EnEndingHero* this) {
this->unk244 = 1;
this->actionFunc = func_80C1E764;
void EnEndingHero1_SetupIdle(EnEndingHero* this) {
this->isIdle = true;
this->actionFunc = EnEndingHero1_Idle;
}
void func_80C1E764(EnEndingHero* this, PlayState* play) {
void EnEndingHero1_Idle(EnEndingHero* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}
@ -60,7 +59,7 @@ void EnEndingHero_Update(Actor* thisx, PlayState* play) {
EnEndingHero* this = THIS;
if (this->unk240 == 0) {
this->unk242 += 1;
this->unk242++;
if (this->unk242 > 2) {
this->unk242 = 0;
this->unk240 = (s16)Rand_ZeroFloat(60.0f) + 0x14;

View File

@ -2,6 +2,7 @@
#define Z_EN_ENDING_HERO_H
#include "global.h"
#include "objects/object_dt/object_dt.h"
struct EnEndingHero;
@ -10,12 +11,12 @@ typedef void (*EnEndingHeroActionFunc)(struct EnEndingHero*, PlayState*);
typedef struct EnEndingHero {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[15];
/* 0x1E2 */ Vec3s morphTable[15];
/* 0x188 */ Vec3s jointTable[OBJECT_DT_LIMB_MAX];
/* 0x1E2 */ Vec3s morphTable[OBJECT_DT_LIMB_MAX];
/* 0x23C */ EnEndingHeroActionFunc actionFunc;
/* 0x240 */ s16 unk240;
/* 0x242 */ s16 unk242;
/* 0x244 */ u16 unk244;
/* 0x244 */ u16 isIdle;
} EnEndingHero; // size = 0x248
#endif // Z_EN_ENDING_HERO_H

View File

@ -5,7 +5,6 @@
*/
#include "z_en_ending_hero2.h"
#include "objects/object_bai/object_bai.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -16,8 +15,8 @@ void EnEndingHero2_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero2_Update(Actor* thisx, PlayState* play);
void EnEndingHero2_Draw(Actor* thisx, PlayState* play);
void func_80C232E8(EnEndingHero2* this);
void func_80C23304(EnEndingHero2* this, PlayState* play);
void EnEndingHero2_SetupIdle(EnEndingHero2* this);
void EnEndingHero2_Idle(EnEndingHero2* this, PlayState* play);
ActorInit En_Ending_Hero2_InitVars = {
ACTOR_EN_ENDING_HERO2,
@ -39,20 +38,20 @@ void EnEndingHero2_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, &object_bai_Skel_007908, &object_bai_Anim_0011C0, this->jointTable,
this->morphTable, 20);
this->morphTable, OBJECT_BAI_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C232E8(this);
EnEndingHero2_SetupIdle(this);
}
void EnEndingHero2_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C232E8(EnEndingHero2* this) {
this->unk27C = 1;
this->actionFunc = func_80C23304;
void EnEndingHero2_SetupIdle(EnEndingHero2* this) {
this->isIdle = true;
this->actionFunc = EnEndingHero2_Idle;
}
void func_80C23304(EnEndingHero2* this, PlayState* play) {
void EnEndingHero2_Idle(EnEndingHero2* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}

View File

@ -2,6 +2,7 @@
#define Z_EN_ENDING_HERO2_H
#include "global.h"
#include "objects/object_bai/object_bai.h"
struct EnEndingHero2;
@ -10,10 +11,10 @@ typedef void (*EnEndingHero2ActionFunc)(struct EnEndingHero2*, PlayState*);
typedef struct EnEndingHero2 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[20];
/* 0x200 */ Vec3s morphTable[20];
/* 0x188 */ Vec3s jointTable[OBJECT_BAI_LIMB_MAX];
/* 0x200 */ Vec3s morphTable[OBJECT_BAI_LIMB_MAX];
/* 0x278 */ EnEndingHero2ActionFunc actionFunc;
/* 0x27C */ u16 unk27C;
/* 0x27C */ u16 isIdle;
} EnEndingHero2; // size = 0x280
#endif // Z_EN_ENDING_HERO2_H

View File

@ -5,7 +5,6 @@
*/
#include "z_en_ending_hero3.h"
#include "objects/object_toryo/object_toryo.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -16,8 +15,8 @@ void EnEndingHero3_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero3_Update(Actor* thisx, PlayState* play);
void EnEndingHero3_Draw(Actor* thisx, PlayState* play);
void func_80C23518(EnEndingHero3* this);
void func_80C23534(EnEndingHero3* this, PlayState* play);
void EnEndingHero3_SetupIdle(EnEndingHero3* this);
void EnEndingHero3_Idle(EnEndingHero3* this, PlayState* play);
ActorInit En_Ending_Hero3_InitVars = {
ACTOR_EN_ENDING_HERO3,
@ -39,20 +38,20 @@ void EnEndingHero3_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, &object_toryo_Skel_007150, &object_toryo_Anim_000E50, this->jointTable,
this->morphTable, 17);
this->morphTable, OBJECT_TORYO_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C23518(this);
EnEndingHero3_SetupIdle(this);
}
void EnEndingHero3_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C23518(EnEndingHero3* this) {
this->unk258 = 1;
this->actionFunc = func_80C23534;
void EnEndingHero3_SetupIdle(EnEndingHero3* this) {
this->isIdle = true;
this->actionFunc = EnEndingHero3_Idle;
}
void func_80C23534(EnEndingHero3* this, PlayState* play) {
void EnEndingHero3_Idle(EnEndingHero3* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}

View File

@ -2,6 +2,7 @@
#define Z_EN_ENDING_HERO3_H
#include "global.h"
#include "objects/object_toryo/object_toryo.h"
struct EnEndingHero3;
@ -10,10 +11,10 @@ typedef void (*EnEndingHero3ActionFunc)(struct EnEndingHero3*, PlayState*);
typedef struct EnEndingHero3 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[17];
/* 0x1EE */ Vec3s morphTable[17];
/* 0x188 */ Vec3s jointTable[OBJECT_TORYO_LIMB_MAX];
/* 0x1EE */ Vec3s morphTable[OBJECT_TORYO_LIMB_MAX];
/* 0x254 */ EnEndingHero3ActionFunc actionFunc;
/* 0x258 */ u16 unk258;
/* 0x258 */ u16 isIdle;
} EnEndingHero3; // size = 0x25C
#endif // Z_EN_ENDING_HERO3_H

View File

@ -5,7 +5,6 @@
*/
#include "z_en_ending_hero4.h"
#include "objects/object_sdn/object_sdn.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -16,8 +15,8 @@ void EnEndingHero4_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero4_Update(Actor* thisx, PlayState* play);
void EnEndingHero4_Draw(Actor* thisx, PlayState* play);
void func_80C23748(EnEndingHero4* this);
void func_80C23764(EnEndingHero4* this, PlayState* play);
void EnEndingHero4_SetupIdle(EnEndingHero4* this);
void EnEndingHero4_Idle(EnEndingHero4* this, PlayState* play);
ActorInit En_Ending_Hero4_InitVars = {
ACTOR_EN_ENDING_HERO4,
@ -39,20 +38,20 @@ void EnEndingHero4_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, &gSoldierSkel, &gSoldierCheerWithSpear, this->jointTable,
this->morphTable, 17);
this->morphTable, SOLDIER_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
func_80C23748(this);
EnEndingHero4_SetupIdle(this);
}
void EnEndingHero4_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C23748(EnEndingHero4* this) {
this->unk258 = 1;
this->actionFunc = func_80C23764;
void EnEndingHero4_SetupIdle(EnEndingHero4* this) {
this->isIdle = true;
this->actionFunc = EnEndingHero4_Idle;
}
void func_80C23764(EnEndingHero4* this, PlayState* play) {
void EnEndingHero4_Idle(EnEndingHero4* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}

View File

@ -2,6 +2,7 @@
#define Z_EN_ENDING_HERO4_H
#include "global.h"
#include "objects/object_sdn/object_sdn.h"
struct EnEndingHero4;
@ -10,10 +11,10 @@ typedef void (*EnEndingHero4ActionFunc)(struct EnEndingHero4*, PlayState*);
typedef struct EnEndingHero4 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[17];
/* 0x1EE */ Vec3s morphTable[17];
/* 0x188 */ Vec3s jointTable[SOLDIER_LIMB_MAX];
/* 0x1EE */ Vec3s morphTable[SOLDIER_LIMB_MAX];
/* 0x254 */ EnEndingHero4ActionFunc actionFunc;
/* 0x258 */ u16 unk258;
/* 0x258 */ u16 isIdle;
} EnEndingHero4; // size = 0x25C
#endif // Z_EN_ENDING_HERO4_H

View File

@ -5,7 +5,6 @@
*/
#include "z_en_ending_hero5.h"
#include "objects/object_daiku/object_daiku.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -16,8 +15,8 @@ void EnEndingHero5_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero5_Update(Actor* thisx, PlayState* play);
void EnEndingHero5_Draw(Actor* thisx, PlayState* play);
void func_80C23980(EnEndingHero5* this);
void func_80C2399C(EnEndingHero5* this, PlayState* play);
void EnEndingHero5_SetupIdle(EnEndingHero5* this);
void EnEndingHero5_Idle(EnEndingHero5* this, PlayState* play);
ActorInit En_Ending_Hero5_InitVars = {
ACTOR_EN_ENDING_HERO5,
@ -39,21 +38,21 @@ void EnEndingHero5_Init(Actor* thisx, PlayState* play) {
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, &object_daiku_Skel_00A850, &object_daiku_Anim_002FA0, this->jointTable,
this->morphTable, 17);
this->morphTable, OBJECT_DAIKU_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
this->unk25C = this->actor.params;
func_80C23980(this);
EnEndingHero5_SetupIdle(this);
}
void EnEndingHero5_Destroy(Actor* thisx, PlayState* play) {
}
void func_80C23980(EnEndingHero5* this) {
this->unk258 = 1;
this->actionFunc = func_80C2399C;
void EnEndingHero5_SetupIdle(EnEndingHero5* this) {
this->isIdle = true;
this->actionFunc = EnEndingHero5_Idle;
}
void func_80C2399C(EnEndingHero5* this, PlayState* play) {
void EnEndingHero5_Idle(EnEndingHero5* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
}
@ -75,7 +74,7 @@ void EnEndingHero5_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
OPEN_DISPS(play->state.gfxCtx);
if (limbIndex == 15) {
if (limbIndex == OBJECT_DAIKU_LIMB_0F) {
gSPDisplayList(POLY_OPA_DISP++, D_80C23BF0[this->unk25C]);
}

View File

@ -2,6 +2,7 @@
#define Z_EN_ENDING_HERO5_H
#include "global.h"
#include "objects/object_daiku/object_daiku.h"
struct EnEndingHero5;
@ -10,10 +11,10 @@ typedef void (*EnEndingHero5ActionFunc)(struct EnEndingHero5*, PlayState*);
typedef struct EnEndingHero5 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[17];
/* 0x1EE */ Vec3s morphTable[17];
/* 0x188 */ Vec3s jointTable[OBJECT_DAIKU_LIMB_MAX];
/* 0x1EE */ Vec3s morphTable[OBJECT_DAIKU_LIMB_MAX];
/* 0x254 */ EnEndingHero5ActionFunc actionFunc;
/* 0x258 */ u16 unk258;
/* 0x258 */ u16 isIdle;
/* 0x25C */ s32 unk25C;
} EnEndingHero5; // size = 0x260

View File

@ -5,11 +5,6 @@
*/
#include "z_en_ending_hero6.h"
#include "objects/object_dt/object_dt.h"
#include "objects/object_daiku/object_daiku.h"
#include "objects/object_bai/object_bai.h"
#include "objects/object_toryo/object_toryo.h"
#include "objects/object_sdn/object_sdn.h"
#define FLAGS (ACTOR_FLAG_1 | ACTOR_FLAG_8)
@ -20,7 +15,6 @@ void EnEndingHero6_Destroy(Actor* thisx, PlayState* play);
void EnEndingHero6_Update(Actor* thisx, PlayState* play);
void EnEndingHero6_Draw(Actor* thisx, PlayState* play);
void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex);
void EnEndingHero6_SetupIdle(EnEndingHero6* this);
void EnEndingHero6_Idle(EnEndingHero6* this, PlayState* play);
@ -36,19 +30,54 @@ ActorInit En_Ending_Hero6_InitVars = {
(ActorFunc)EnEndingHero6_Draw,
};
static FlexSkeletonHeader* sSkeletons[] = {
&object_dt_Skel_00B0CC, &object_bai_Skel_007908, &object_toryo_Skel_007150, &gSoldierSkel,
&object_daiku_Skel_00A850, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850, &object_daiku_Skel_00A850,
&object_daiku_Skel_00A850,
typedef enum {
/* 0 */ ENDING_HERO6_TYPE_DT,
/* 1 */ ENDING_HERO6_TYPE_BAI,
/* 2 */ ENDING_HERO6_TYPE_TORYO,
/* 3 */ ENDING_HERO6_TYPE_SOLDIER,
/* 4 */ ENDING_HERO6_TYPE_DAIKU_RED,
/* 5 */ ENDING_HERO6_TYPE_DAIKU_BLUE,
/* 6 */ ENDING_HERO6_TYPE_DAIKU_GREEN,
/* 7 */ ENDING_HERO6_TYPE_DAIKU_PURPLE,
/* 8 */ ENDING_HERO6_TYPE_DAIKU_ORANGE,
/* 9 */ ENDING_HERO6_TYPE_MAX
} EndingHero6Type;
static FlexSkeletonHeader* sSkeletons[ENDING_HERO6_TYPE_MAX] = {
&object_dt_Skel_00B0CC, // ENDING_HERO6_TYPE_DT
&object_bai_Skel_007908, // ENDING_HERO6_TYPE_BAI
&object_toryo_Skel_007150, // ENDING_HERO6_TYPE_TORYO
&gSoldierSkel, // ENDING_HERO6_TYPE_SOLDIER
&object_daiku_Skel_00A850, // ENDING_HERO6_TYPE_DAIKU_RED
&object_daiku_Skel_00A850, // ENDING_HERO6_TYPE_DAIKU_BLUE
&object_daiku_Skel_00A850, // ENDING_HERO6_TYPE_DAIKU_GREEN
&object_daiku_Skel_00A850, // ENDING_HERO6_TYPE_DAIKU_PURPLE
&object_daiku_Skel_00A850, // ENDING_HERO6_TYPE_DAIKU_ORANGE
};
static AnimationHeader* sAnimations[] = {
&object_dt_Anim_000BE0, &object_bai_Anim_0011C0, &object_toryo_Anim_000E50,
&gSoldierCheerWithSpear, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
&object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0, &object_daiku_Anim_002FA0,
static AnimationHeader* sAnimations[ENDING_HERO6_TYPE_MAX] = {
&object_dt_Anim_000BE0, // ENDING_HERO6_TYPE_DT
&object_bai_Anim_0011C0, // ENDING_HERO6_TYPE_BAI
&object_toryo_Anim_000E50, // ENDING_HERO6_TYPE_TORYO
&gSoldierCheerWithSpear, // ENDING_HERO6_TYPE_SOLDIER
&object_daiku_Anim_002FA0, // ENDING_HERO6_TYPE_DAIKU_RED
&object_daiku_Anim_002FA0, // ENDING_HERO6_TYPE_DAIKU_BLUE
&object_daiku_Anim_002FA0, // ENDING_HERO6_TYPE_DAIKU_GREEN
&object_daiku_Anim_002FA0, // ENDING_HERO6_TYPE_DAIKU_PURPLE
&object_daiku_Anim_002FA0, // ENDING_HERO6_TYPE_DAIKU_ORANGE
};
static s32 sLimbCounts[] = { 15, 20, 17, 17, 17, 17, 17, 17, 17 };
static s32 sLimbCounts[ENDING_HERO6_TYPE_MAX] = {
OBJECT_DT_LIMB_MAX, // ENDING_HERO6_TYPE_DT
OBJECT_BAI_LIMB_MAX, // ENDING_HERO6_TYPE_BAI
OBJECT_TORYO_LIMB_MAX, // ENDING_HERO6_TYPE_TORYO
SOLDIER_LIMB_MAX, // ENDING_HERO6_TYPE_SOLDIER
OBJECT_DAIKU_LIMB_MAX, // ENDING_HERO6_TYPE_DAIKU_RED
OBJECT_DAIKU_LIMB_MAX, // ENDING_HERO6_TYPE_DAIKU_BLUE
OBJECT_DAIKU_LIMB_MAX, // ENDING_HERO6_TYPE_DAIKU_GREEN
OBJECT_DAIKU_LIMB_MAX, // ENDING_HERO6_TYPE_DAIKU_PURPLE
OBJECT_DAIKU_LIMB_MAX, // ENDING_HERO6_TYPE_DAIKU_ORANGE
};
void EnEndingHero6_Init(Actor* thisx, PlayState* play) {
EnEndingHero6* this = THIS;
@ -57,8 +86,8 @@ void EnEndingHero6_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.targetMode = 6;
this->actor.gravity = -3.0f;
SkelAnime_InitFlex(play, &this->skelAnime, sSkeletons[this->npcIndex], sAnimations[this->npcIndex],
this->jointTable, this->morphTable, sLimbCounts[this->npcIndex]);
SkelAnime_InitFlex(play, &this->skelAnime, sSkeletons[this->type], sAnimations[this->type], this->jointTable,
this->morphTable, sLimbCounts[this->type]);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 25.0f);
EnEndingHero6_SetupIdle(this);
}
@ -66,15 +95,16 @@ void EnEndingHero6_Init(Actor* thisx, PlayState* play) {
void EnEndingHero6_Destroy(Actor* thisx, PlayState* play) {
}
void EnEndingHero6_InitSkelAnime(EnEndingHero6* this, s32 npcIndex) {
this->animIndex = npcIndex;
this->frameCount = Animation_GetLastFrame(sAnimations[npcIndex]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.f, this->frameCount, ANIMMODE_LOOP, 0.0f);
void EnEndingHero6_ChangeAnim(EnEndingHero6* this, s32 type) {
this->animIndex = type;
this->animEndFrame = Animation_GetLastFrame(sAnimations[type]);
Animation_Change(&this->skelAnime, sAnimations[this->animIndex], 1.0f, 0.f, this->animEndFrame, ANIMMODE_LOOP,
0.0f);
}
void EnEndingHero6_SetupIdle(EnEndingHero6* this) {
EnEndingHero6_InitSkelAnime(this, this->npcIndex);
this->isIdle = 1;
EnEndingHero6_ChangeAnim(this, this->type);
this->isIdle = true;
this->actionFunc = EnEndingHero6_Idle;
}
@ -107,16 +137,21 @@ void EnEndingHero6_Update(Actor* thisx, PlayState* play) {
}
void EnEndingHero6_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Gfx* D_80C2426C[] = { object_daiku_DL_0070C0, object_daiku_DL_006FB0, object_daiku_DL_006E80,
object_daiku_DL_006D70, object_daiku_DL_00A390 };
static Gfx* D_80C2426C[] = {
object_daiku_DL_0070C0, // ENDING_HERO6_TYPE_DAIKU_RED
object_daiku_DL_006FB0, // ENDING_HERO6_TYPE_DAIKU_BLUE
object_daiku_DL_006E80, // ENDING_HERO6_TYPE_DAIKU_GREEN
object_daiku_DL_006D70, // ENDING_HERO6_TYPE_DAIKU_PURPLE
object_daiku_DL_00A390, // ENDING_HERO6_TYPE_DAIKU_ORANGE
};
EnEndingHero6* this = THIS;
s32 index;
s32 daikuIndex;
OPEN_DISPS(play->state.gfxCtx);
if ((this->npcIndex >= 4) && (limbIndex == 15)) {
index = this->npcIndex - 4;
gSPDisplayList(POLY_OPA_DISP++, D_80C2426C[index]);
if ((this->type >= ENDING_HERO6_TYPE_DAIKU_RED) && (limbIndex == OBJECT_DAIKU_LIMB_0F)) {
daikuIndex = this->type - ENDING_HERO6_TYPE_DAIKU_RED;
gSPDisplayList(POLY_OPA_DISP++, D_80C2426C[daikuIndex]);
}
CLOSE_DISPS(play->state.gfxCtx);
@ -130,7 +165,7 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) {
EnEndingHero6* this = THIS;
s32 index = 0;
if (this->isIdle == 1) {
if (this->isIdle == true) {
OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
@ -139,24 +174,24 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) {
if ((this->objectIndex >= 0) && Object_IsLoaded(&play->objectCtx, this->objectIndex)) {
gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objectIndex].segment);
switch (this->npcIndex) {
case 4:
switch (this->type) {
case ENDING_HERO6_TYPE_DAIKU_RED:
gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255);
break;
case 5:
case ENDING_HERO6_TYPE_DAIKU_BLUE:
gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255);
break;
case 6:
case ENDING_HERO6_TYPE_DAIKU_GREEN:
gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255);
break;
case 7:
case ENDING_HERO6_TYPE_DAIKU_PURPLE:
gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255);
break;
case 8:
case ENDING_HERO6_TYPE_DAIKU_ORANGE:
gDPSetEnvColor(POLY_OPA_DISP++, 245, 155, 0, 255);
break;
@ -164,7 +199,7 @@ void EnEndingHero6_Draw(Actor* thisx, PlayState* play) {
break;
}
if (this->npcIndex == 0) {
if (this->type == ENDING_HERO6_TYPE_DT) {
gSPSegment(POLY_OPA_DISP++, 0x08, Lib_SegmentedToVirtual(sEyeTextures[this->eyeState]));
if (this->eyeState < 3) {

View File

@ -2,24 +2,36 @@
#define Z_EN_ENDING_HERO6_H
#include "global.h"
#include "objects/object_dt/object_dt.h"
#include "objects/object_daiku/object_daiku.h"
#include "objects/object_bai/object_bai.h"
#include "objects/object_toryo/object_toryo.h"
#include "objects/object_sdn/object_sdn.h"
struct EnEndingHero6;
typedef void (*EnEndingHero6ActionFunc)(struct EnEndingHero6*, PlayState*);
#define ENDING_HERO6_LIMB_MAX \
MAX(MAX(MAX(MAX((s32)OBJECT_DT_LIMB_MAX, \
(s32)OBJECT_BAI_LIMB_MAX), \
(s32)OBJECT_TORYO_LIMB_MAX), \
(s32)SOLDIER_LIMB_MAX), \
(s32)OBJECT_DAIKU_LIMB_MAX)
typedef struct EnEndingHero6 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[20];
/* 0x200 */ Vec3s morphTable[20];
/* 0x188 */ Vec3s jointTable[ENDING_HERO6_LIMB_MAX];
/* 0x200 */ Vec3s morphTable[ENDING_HERO6_LIMB_MAX];
/* 0x278 */ EnEndingHero6ActionFunc actionFunc;
/* 0x27C */ s32 animIndex;
/* 0x280 */ s32 npcIndex;
/* 0x280 */ s32 type;
/* 0x284 */ s8 objectIndex;
/* 0x286 */ s16 timer;
/* 0x288 */ s16 blinkTimer;
/* 0x28A */ s16 eyeState;
/* 0x28C */ f32 frameCount;
/* 0x28C */ f32 animEndFrame;
/* 0x290 */ s16 isIdle;
} EnEndingHero6; // size = 0x294

View File

@ -75,7 +75,7 @@ void EnEstone_Init(Actor* thisx, PlayState* play) {
this->scale = (Rand_ZeroFloat(1.0f) * 0.005f) + 0.005f;
this->actor.velocity.y = Rand_ZeroFloat(10.0f) + 15.0f;
this->actor.gravity = -2.0f;
} else {
} else { // ENESTONE_TYPE_SMALL
this->actor.speed = Rand_ZeroFloat(3.0f) + 1.0f;
this->scale = (Rand_ZeroFloat(1.0f) * 0.003f) + 0.003f;
this->actor.velocity.y = Rand_ZeroFloat(5.0f) + 7.0f;

View File

@ -6517,7 +6517,7 @@
0x808E13FC:("DemoTreLgt_Draw",),
0x808E1560:("EnEncount2_Init",),
0x808E16B4:("EnEncount2_Destroy",),
0x808E16FC:("EnEncount2_SetIdle",),
0x808E16FC:("EnEncount2_SetupIdle",),
0x808E1714:("EnEncount2_Idle",),
0x808E17C4:("EnEncount2_Popped",),
0x808E18A8:("EnEncount2_Die",),
@ -16984,8 +16984,8 @@
0x80C1E568:("EnDrs_Draw",),
0x80C1E690:("EnEndingHero_Init",),
0x80C1E738:("EnEndingHero_Destroy",),
0x80C1E748:("func_80C1E748",),
0x80C1E764:("func_80C1E764",),
0x80C1E748:("EnEndingHero1_SetupIdle",),
0x80C1E764:("EnEndingHero1_Idle",),
0x80C1E790:("EnEndingHero_Update",),
0x80C1E84C:("EnEndingHero_Draw",),
0x80C1E9E0:("DmBal_Init",),
@ -17069,26 +17069,26 @@
0x80C23154:("EnBh_Draw",),
0x80C23230:("EnEndingHero2_Init",),
0x80C232D8:("EnEndingHero2_Destroy",),
0x80C232E8:("func_80C232E8",),
0x80C23304:("func_80C23304",),
0x80C232E8:("EnEndingHero2_SetupIdle",),
0x80C23304:("EnEndingHero2_Idle",),
0x80C23330:("EnEndingHero2_Update",),
0x80C23398:("EnEndingHero2_Draw",),
0x80C23460:("EnEndingHero3_Init",),
0x80C23508:("EnEndingHero3_Destroy",),
0x80C23518:("func_80C23518",),
0x80C23534:("func_80C23534",),
0x80C23518:("EnEndingHero3_SetupIdle",),
0x80C23534:("EnEndingHero3_Idle",),
0x80C23560:("EnEndingHero3_Update",),
0x80C235C8:("EnEndingHero3_Draw",),
0x80C23690:("EnEndingHero4_Init",),
0x80C23738:("EnEndingHero4_Destroy",),
0x80C23748:("func_80C23748",),
0x80C23764:("func_80C23764",),
0x80C23748:("EnEndingHero4_SetupIdle",),
0x80C23764:("EnEndingHero4_Idle",),
0x80C23790:("EnEndingHero4_Update",),
0x80C237F8:("EnEndingHero4_Draw",),
0x80C238C0:("EnEndingHero5_Init",),
0x80C23970:("EnEndingHero5_Destroy",),
0x80C23980:("func_80C23980",),
0x80C2399C:("func_80C2399C",),
0x80C23980:("EnEndingHero5_SetupIdle",),
0x80C2399C:("EnEndingHero5_Idle",),
0x80C239C8:("EnEndingHero5_Update",),
0x80C23A30:("EnEndingHero5_PostLimbDraw",),
0x80C23A7C:("EnEndingHero5_Draw",),

View File

@ -12771,7 +12771,7 @@
0x80AC45B0:("D_80AC45B0","UNK_TYPE1","",0x1),
0x80AC45B4:("D_80AC45B4","UNK_TYPE1","",0x1),
0x80AC45B8:("D_80AC45B8","UNK_TYPE1","",0x1),
0x80AC45BC:("D_80AC45BC","UNK_TYPE1","",0x1),
0x80AC45BC:("sLimbToBodyParts","UNK_TYPE1","",0x1),
0x80AC45D0:("D_80AC45D0","UNK_TYPE1","",0x1),
0x80AC460C:("D_80AC460C","UNK_TYPE1","",0x1),
0x80AC4610:("D_80AC4610","f32","",0x4),
@ -14662,7 +14662,7 @@
0x80B65044:("D_80B65044","UNK_TYPE1","",0x1),
0x80B65064:("D_80B65064","UNK_TYPE1","",0x1),
0x80B6506C:("D_80B6506C","UNK_TYPE1","",0x1),
0x80B65078:("D_80B65078","UNK_TYPE1","",0x1),
0x80B65078:("sLimbToBodyParts","UNK_TYPE1","",0x1),
0x80B65084:("D_80B65084","UNK_TYPE1","",0x1),
0x80B650B0:("D_80B650B0","f32","",0x4),
0x80B650B4:("D_80B650B4","f32","",0x4),