mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -142,6 +142,9 @@ void EnEncount1_SpawnActor(EnEncount1* this, PlayState* play) {
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
actorId = sActorIds[this->type];
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user