Body Parts Docs (#1333)

* body parts WIP

* continue WIP

* finish body parts

* cleanup

* missed one

* Missed Enum

* PR Review

* next PR review

* s32 cast

* TRUNCF_BINANG

* rm unnecessary shadow

* PR Review

* missed some

* oops
This commit is contained in:
engineer124
2023-08-15 00:08:45 +10:00
committed by GitHub
parent 05c2221769
commit affb1eaf0f
132 changed files with 2563 additions and 1243 deletions
+2 -2
View File
@@ -657,8 +657,8 @@ void func_800BE504(Actor* actor, ColliderCylinder* collider);
void func_800BE568(Actor* actor, ColliderSphere* collider);
void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex);
s32 Actor_IsSmallChest(struct EnBox* chest);
void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type);
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange);
void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s16 bodyPartsCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type);
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s32 bodyPartsCount, s32 effectsPerBodyPart, f32 scale, f32 scaleRange);
void ActorOverlayTable_FaultClient(void* arg0, void* arg1);
uintptr_t ActorOverlayTable_FaultAddrConv(uintptr_t address, void* param);
+1
View File
@@ -12,6 +12,7 @@ struct SkelAnime;
struct PlayerAnimationFrame;
#define LIMB_DONE 0xFF
#define BODYPART_NONE -1
#define ANIM_FLAG_1 (1 << 0)
#define ANIM_FLAG_UPDATE_Y (1 << 1)
+43 -4
View File
@@ -6,7 +6,27 @@
struct EnHy;
#define ENHY_LIMB_MAX 16
//! @note: any actor that uses the EnHy system should
//! have a skeleton that aligns with the enum below.
typedef enum EnHyLimb {
/* 0x00 */ ENHY_LIMB_NONE,
/* 0x01 */ ENHY_LIMB_PELVIS,
/* 0x02 */ ENHY_LIMB_LEFT_THIGH,
/* 0x03 */ ENHY_LIMB_LEFT_SHIN,
/* 0x04 */ ENHY_LIMB_LEFT_FOOT,
/* 0x05 */ ENHY_LIMB_RIGHT_THIGH,
/* 0x06 */ ENHY_LIMB_RIGHT_SHIN,
/* 0x07 */ ENHY_LIMB_RIGHT_FOOT,
/* 0x08 */ ENHY_LIMB_TORSO,
/* 0x09 */ ENHY_LIMB_LEFT_UPPER_ARM,
/* 0x0A */ ENHY_LIMB_LEFT_FOREARM,
/* 0x0B */ ENHY_LIMB_LEFT_HAND,
/* 0x0C */ ENHY_LIMB_RIGHT_UPPER_ARM,
/* 0x0D */ ENHY_LIMB_RIGHT_FOREARM,
/* 0x0E */ ENHY_LIMB_RIGHT_HAND,
/* 0x0F */ ENHY_LIMB_HEAD,
/* 0x10 */ ENHY_LIMB_MAX
} EnHyLimb;
//! TODO: Better animaion enum names when animations are documented
typedef enum {
@@ -36,6 +56,25 @@ typedef enum {
typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*);
typedef enum EnHyBodyPart {
/* 0 */ ENHY_BODYPART_0,
/* 1 */ ENHY_BODYPART_1,
/* 2 */ ENHY_BODYPART_2,
/* 3 */ ENHY_BODYPART_3,
/* 4 */ ENHY_BODYPART_4,
/* 5 */ ENHY_BODYPART_5,
/* 6 */ ENHY_BODYPART_6,
/* 7 */ ENHY_BODYPART_7,
/* 8 */ ENHY_BODYPART_8,
/* 9 */ ENHY_BODYPART_9,
/* 10 */ ENHY_BODYPART_10,
/* 11 */ ENHY_BODYPART_11,
/* 12 */ ENHY_BODYPART_12,
/* 13 */ ENHY_BODYPART_13,
/* 14 */ ENHY_BODYPART_14,
/* 15 */ ENHY_BODYPART_MAX
} EnHyBodyPart;
typedef struct EnHy {
/* 0x000 */ Actor actor;
/* 0x144 */ EnHyActionFunc actionFunc;
@@ -65,14 +104,14 @@ typedef struct EnHy {
/* 0x2E4 */ Vec3s prevTorsoRot;
/* 0x2EA */ s16 fidgetTableY[ENHY_LIMB_MAX];
/* 0x30A */ s16 fidgetTableZ[ENHY_LIMB_MAX];
/* 0x32C */ Vec3f bodyPartsPos[15];
/* 0x32C */ Vec3f bodyPartsPos[ENHY_BODYPART_MAX];
/* 0x3E0 */ UNK_TYPE1 unk_3E0[0x6];
/* 0x3E6 */ s16 eyeTexIndex;
/* 0x3E8 */ s16 blinkTimer;
} EnHy; // size = 0x3EC
extern s8 gEnHyBodyParts[];
extern s8 gEnHyParentBodyParts[];
extern s8 gEnHyLimbToBodyParts[];
extern s8 gEnHyParentShadowBodyParts[];
extern u8 gEnHyShadowSizes[];
s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex);
+49 -49
View File
@@ -4706,20 +4706,20 @@ TexturePtr sElectricSparkTextures[] = {
};
/**
* Draw common damage effects applied to each limb provided in limbPos
* Draw common damage effects applied to each body part provided in bodyPartsPos
*/
void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale,
void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s16 bodyPartsCount, f32 effectScale,
f32 frozenSteamScale, f32 effectAlpha, u8 type) {
if (effectAlpha > 0.001f) {
s32 twoTexScrollParam;
s16 limbIndex;
s16 bodyPartIndex;
MtxF* currentMatrix;
f32 alpha;
f32 frozenScale;
f32 lightOrbsScale;
f32 electricSparksScale;
f32 steamScale;
Vec3f* limbPosStart = limbPos;
Vec3f* bodyPartsPosStart = bodyPartsPos;
u32 gameplayFrames = play->gameplayFrames;
f32 effectAlphaScaled;
@@ -4747,7 +4747,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
case ACTOR_DRAW_DMGEFF_FROZEN_SFX:
frozenScale = ((KREG(19) * 0.01f) + 2.3f) * effectScale;
steamScale = ((KREG(28) * 0.0001f) + 0.035f) * frozenSteamScale;
func_800BCC68(limbPos, play);
func_800BCC68(bodyPartsPos, play);
// Setup to draw ice over frozen actor
@@ -4759,11 +4759,11 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
effectAlphaScaled = effectAlpha * 255.0f;
// Apply and draw ice over each limb of frozen actor
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
alpha = limbIndex & 3;
// Apply and draw ice over each body part of frozen actor
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
alpha = bodyPartIndex & 3;
alpha = effectAlphaScaled - (30.0f * alpha);
if (effectAlphaScaled < (30.0f * (limbIndex & 3))) {
if (effectAlphaScaled < (30.0f * (bodyPartIndex & 3))) {
alpha = 0.0f;
}
if (alpha > 255.0f) {
@@ -4772,14 +4772,14 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
gDPSetEnvColor(POLY_XLU_DISP++, KREG(20) + 200, KREG(21) + 200, KREG(22) + 255, (u8)alpha);
Matrix_Translate(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
Matrix_Translate(bodyPartsPos->x, bodyPartsPos->y, bodyPartsPos->z, MTXMODE_NEW);
Matrix_Scale(frozenScale, frozenScale, frozenScale, MTXMODE_APPLY);
if (limbIndex & 1) {
if (bodyPartIndex & 1) {
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
}
if (limbIndex & 2) {
if (bodyPartIndex & 2) {
Matrix_RotateZF(M_PI, MTXMODE_APPLY);
}
@@ -4789,7 +4789,7 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
gSPDisplayList(POLY_XLU_DISP++, gEffIceFragment2ModelDL);
}
limbPos = limbPosStart; // reset limbPos
bodyPartsPos = bodyPartsPosStart; // reset bodyPartsPos
// Setup to draw steam over frozen actor
@@ -4804,14 +4804,14 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 195, 225, 235, (u8)alpha);
// Apply and draw steam over each limb of frozen actor
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
twoTexScrollParam = ((limbIndex * 3) + gameplayFrames);
// Apply and draw steam over each body part of frozen actor
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
twoTexScrollParam = ((bodyPartIndex * 3) + gameplayFrames);
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, twoTexScrollParam * 3, twoTexScrollParam * -12,
32, 64, 1, 0, 0, 32, 32));
Matrix_Translate(limbPos->x, limbPos->y, limbPos->z, MTXMODE_NEW);
Matrix_Translate(bodyPartsPos->x, bodyPartsPos->y, bodyPartsPos->z, MTXMODE_NEW);
Matrix_ReplaceRotation(&play->billboardMtxF);
Matrix_Scale(steamScale, steamScale, 1.0f, MTXMODE_APPLY);
@@ -4838,11 +4838,11 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
effectAlphaScaled = effectAlpha * 255.0f;
// Apply and draw fire on every limb
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
alpha = limbIndex & 3;
// Apply and draw fire on every body part
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
alpha = bodyPartIndex & 3;
alpha = effectAlphaScaled - 30.0f * alpha;
if (effectAlphaScaled < 30.0f * (limbIndex & 3)) {
if (effectAlphaScaled < 30.0f * (bodyPartIndex & 3)) {
alpha = 0.0f;
}
if (alpha > 255.0f) {
@@ -4856,12 +4856,12 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
gSPSegment(POLY_XLU_DISP++, 0x08,
Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 32, 64, 1, 0,
((limbIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128));
((bodyPartIndex * 10 + gameplayFrames) * -20) & 0x1FF, 32, 128));
Matrix_RotateYF(M_PI, MTXMODE_APPLY);
currentMatrix->mf[3][0] = limbPos->x;
currentMatrix->mf[3][1] = limbPos->y;
currentMatrix->mf[3][2] = limbPos->z;
currentMatrix->mf[3][0] = bodyPartsPos->x;
currentMatrix->mf[3][1] = bodyPartsPos->y;
currentMatrix->mf[3][2] = bodyPartsPos->z;
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -4898,12 +4898,12 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
Matrix_Put(&play->billboardMtxF);
Matrix_Scale(lightOrbsScale, lightOrbsScale, 1.0f, MTXMODE_APPLY);
// Apply and draw a light orb over each limb of frozen actor
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
// Apply and draw a light orb over each body part of frozen actor
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
Matrix_RotateZF(Rand_CenteredFloat(2 * M_PI), MTXMODE_APPLY);
currentMatrix->mf[3][0] = limbPos->x;
currentMatrix->mf[3][1] = limbPos->y;
currentMatrix->mf[3][2] = limbPos->z;
currentMatrix->mf[3][0] = bodyPartsPos->x;
currentMatrix->mf[3][1] = bodyPartsPos->y;
currentMatrix->mf[3][2] = bodyPartsPos->z;
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -4936,14 +4936,14 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
Matrix_Put(&play->billboardMtxF);
Matrix_Scale(electricSparksScale, electricSparksScale, electricSparksScale, MTXMODE_APPLY);
// Every limb draws two electric sparks at random orientations
for (limbIndex = 0; limbIndex < limbPosCount; limbIndex++, limbPos++) {
// Every body part draws two electric sparks at random orientations
for (bodyPartIndex = 0; bodyPartIndex < bodyPartsCount; bodyPartIndex++, bodyPartsPos++) {
// first electric spark
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->z;
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -4953,9 +4953,9 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
// second electric spark
Matrix_RotateXFApply(Rand_ZeroFloat(2 * M_PI));
Matrix_RotateZF(Rand_ZeroFloat(2 * M_PI), MTXMODE_APPLY);
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + limbPos->z;
currentMatrix->mf[3][0] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->x;
currentMatrix->mf[3][1] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->y;
currentMatrix->mf[3][2] = Rand_CenteredFloat((f32)sREG(24) + 30.0f) + bodyPartsPos->z;
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
@@ -4970,11 +4970,11 @@ void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16
}
}
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb,
f32 scale, f32 scaleRange) {
static Color_RGBA8 primColor = { 170, 255, 255, 255 };
static Color_RGBA8 envColor = { 200, 200, 255, 255 };
static Vec3f accel = { 0.0f, -1.0f, 0.0f };
void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s32 bodyPartsCount,
s32 effectsPerBodyPart, f32 scale, f32 scaleRange) {
static Color_RGBA8 sPrimColor = { 170, 255, 255, 255 };
static Color_RGBA8 sEnvColor = { 200, 200, 255, 255 };
static Vec3f sAccel = { 0.0f, -1.0f, 0.0f };
s32 i;
s32 pad;
Vec3f velocity;
@@ -4984,10 +4984,10 @@ void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 l
SoundSource_PlaySfxAtFixedWorldPos(play, &actor->world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < limbPosCount; i++) {
yaw = Actor_WorldYawTowardPoint(actor, limbPos);
for (i = 0; i < bodyPartsCount; i++) {
yaw = Actor_WorldYawTowardPoint(actor, bodyPartsPos);
for (j = 0; j < effectsPerLimb; j++) {
for (j = 0; j < effectsPerBodyPart; j++) {
randomYaw = ((s32)Rand_Next() >> 0x13) + yaw;
velocity.z = Rand_ZeroFloat(5.0f);
@@ -4996,10 +4996,10 @@ void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 l
velocity.y = Rand_ZeroFloat(4.0f) + 8.0f;
velocity.z *= Math_CosS(randomYaw);
EffectSsEnIce_Spawn(play, limbPos, Rand_ZeroFloat(scaleRange) + scale, &velocity, &accel, &primColor,
&envColor, 30);
EffectSsEnIce_Spawn(play, bodyPartsPos, Rand_ZeroFloat(scaleRange) + scale, &velocity, &sAccel, &sPrimColor,
&sEnvColor, 30);
}
limbPos++;
bodyPartsPos++;
}
}
+1 -1
View File
@@ -481,7 +481,7 @@ s32 Camera_GetFocalActorPos(Vec3f* dst, Camera* camera) {
Actor* focalActor = camera->focalActor;
if (camera->focalActor == &GET_PLAYER(camera->play)->actor) {
*dst = ((Player*)focalActor)->bodyPartsPos[0];
*dst = ((Player*)focalActor)->bodyPartsPos[PLAYER_BODYPART_WAIST];
return dst;
} else {
Actor_GetWorldPosShapeRot(&focalPosRot, camera->focalActor);
+52 -3
View File
@@ -35,11 +35,60 @@ static AnimationInfoS sAnimationInfo[] = {
{ &object_boj_Anim_005D9C, 1.0f, 0, -1, ANIMMODE_LOOP, -8 },
};
s8 gEnHyBodyParts[] = { -1, 1, 12, 13, 14, 9, 10, 11, 0, 6, 7, 8, 3, 4, 5, 2 };
s8 gEnHyLimbToBodyParts[ENHY_LIMB_MAX] = {
BODYPART_NONE, // ENHY_LIMB_NONE
ENHY_BODYPART_1, // ENHY_LIMB_PELVIS
ENHY_BODYPART_12, // ENHY_LIMB_LEFT_THIGH
ENHY_BODYPART_13, // ENHY_LIMB_LEFT_SHIN
ENHY_BODYPART_14, // ENHY_LIMB_LEFT_FOOT
ENHY_BODYPART_9, // ENHY_LIMB_RIGHT_THIGH
ENHY_BODYPART_10, // ENHY_LIMB_RIGHT_SHIN
ENHY_BODYPART_11, // ENHY_LIMB_RIGHT_FOOT
ENHY_BODYPART_0, // ENHY_LIMB_TORSO
ENHY_BODYPART_6, // ENHY_LIMB_LEFT_UPPER_ARM
ENHY_BODYPART_7, // ENHY_LIMB_LEFT_FOREARM
ENHY_BODYPART_8, // ENHY_LIMB_LEFT_HAND
ENHY_BODYPART_3, // ENHY_LIMB_RIGHT_UPPER_ARM
ENHY_BODYPART_4, // ENHY_LIMB_RIGHT_FOREARM
ENHY_BODYPART_5, // ENHY_LIMB_RIGHT_HAND
ENHY_BODYPART_2, // ENHY_LIMB_HEAD
};
s8 gEnHyParentBodyParts[] = { 0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13 };
s8 gEnHyParentShadowBodyParts[ENHY_BODYPART_MAX] = {
ENHY_BODYPART_0, // ENHY_BODYPART_0
ENHY_BODYPART_0, // ENHY_BODYPART_1
ENHY_BODYPART_0, // ENHY_BODYPART_2
ENHY_BODYPART_0, // ENHY_BODYPART_3
ENHY_BODYPART_3, // ENHY_BODYPART_4
ENHY_BODYPART_4, // ENHY_BODYPART_5
ENHY_BODYPART_0, // ENHY_BODYPART_6
ENHY_BODYPART_6, // ENHY_BODYPART_7
ENHY_BODYPART_7, // ENHY_BODYPART_8
ENHY_BODYPART_0, // ENHY_BODYPART_9
ENHY_BODYPART_9, // ENHY_BODYPART_10
ENHY_BODYPART_10, // ENHY_BODYPART_11
ENHY_BODYPART_0, // ENHY_BODYPART_12
ENHY_BODYPART_12, // ENHY_BODYPART_13
ENHY_BODYPART_13, // ENHY_BODYPART_14
};
u8 gEnHyShadowSizes[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
u8 gEnHyShadowSizes[ENHY_BODYPART_MAX] = {
0, // ENHY_BODYPART_0
0, // ENHY_BODYPART_1
0, // ENHY_BODYPART_2
0, // ENHY_BODYPART_3
0, // ENHY_BODYPART_4
0, // ENHY_BODYPART_5
0, // ENHY_BODYPART_6
0, // ENHY_BODYPART_7
0, // ENHY_BODYPART_8
0, // ENHY_BODYPART_9
0, // ENHY_BODYPART_10
0, // ENHY_BODYPART_11
0, // ENHY_BODYPART_12
0, // ENHY_BODYPART_13
0, // ENHY_BODYPART_14
};
s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex) {
s16 frameCount;
+1 -1
View File
@@ -974,7 +974,7 @@ void SubS_GenShadowTex(Vec3f bodyPartsPos[], Vec3f* worldPos, u8* tex, f32 tween
s32 startRow;
for (i = 0; i < bodyPartsNum; i++) {
if (parentBodyParts[i] >= 0) {
if (parentBodyParts[i] > BODYPART_NONE) {
parentBodyPart = parentBodyParts[i];
bodyPartPos = &bodyPartsPos[i];
@@ -227,7 +227,7 @@ void BgCraceMovebg_Update(Actor* thisx, PlayState* play) {
}
this->actionFunc(this, play);
Math_Vec3f_Copy(&this->prevPlayerPos, &player->bodyPartsPos[0]);
Math_Vec3f_Copy(&this->prevPlayerPos, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]);
}
/**
+38 -20
View File
@@ -2196,24 +2196,42 @@ s32 Boss03_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f*
* Since there are two sets of ColliderJntSph, indices < 2 (ARRAY_COUNT(sHeadJntSphElementsInit)) refers to the first
* collider and indices >= 2 refers to the second one
*/
s8 sGyorgSphElementIndices[] = {
-1, // GYORG_LIMB_NONE,
-1, // GYORG_LIMB_ROOT,
0, // GYORG_LIMB_HEAD,
-1, // GYORG_LIMB_BODY_ROOT,
4, // GYORG_LIMB_UPPER_TRUNK,
5, // GYORG_LIMB_LOWER_TRUNK,
6, // GYORG_LIMB_TAIL,
-1, // GYORG_LIMB_RIGHT_FIN_ROOT,
2, // GYORG_LIMB_UPPER_RIGHT_FIN,
-1, // GYORG_LIMB_LOWER_RIGHT_FIN,
-1, // GYORG_LIMB_LEFT_FIN_ROOT,
3, // GYORG_LIMB_UPPER_LEFT_FIN,
-1, // GYORG_LIMB_LOWER_LEFT_FIN,
-1, // GYORG_LIMB_JAW_ROOT,
1, // GYORG_LIMB_JAW,
-1, // GYORG_LIMB_MAX
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
static s8 sLimbToSphere[2][GYORG_LIMB_MAX] = {
{
-1, // GYORG_LIMB_NONE
-1, // GYORG_LIMB_ROOT
0, // GYORG_LIMB_HEAD
-1, // GYORG_LIMB_BODY_ROOT
4, // GYORG_LIMB_UPPER_TRUNK
5, // GYORG_LIMB_LOWER_TRUNK
6, // GYORG_LIMB_TAIL
-1, // GYORG_LIMB_RIGHT_FIN_ROOT
2, // GYORG_LIMB_UPPER_RIGHT_FIN
-1, // GYORG_LIMB_LOWER_RIGHT_FIN
-1, // GYORG_LIMB_LEFT_FIN_ROOT
3, // GYORG_LIMB_UPPER_LEFT_FIN
-1, // GYORG_LIMB_LOWER_LEFT_FIN
-1, // GYORG_LIMB_JAW_ROOT
1, // GYORG_LIMB_JAW
},
// unused
{
-1, // GYORG_LIMB_NONE
-1, // GYORG_LIMB_ROOT
-1, // GYORG_LIMB_HEAD
-1, // GYORG_LIMB_BODY_ROOT
-1, // GYORG_LIMB_UPPER_TRUNK
-1, // GYORG_LIMB_LOWER_TRUNK
-1, // GYORG_LIMB_TAIL
-1, // GYORG_LIMB_RIGHT_FIN_ROOT
-1, // GYORG_LIMB_UPPER_RIGHT_FIN
-1, // GYORG_LIMB_LOWER_RIGHT_FIN
-1, // GYORG_LIMB_LEFT_FIN_ROOT
-1, // GYORG_LIMB_UPPER_LEFT_FIN
-1, // GYORG_LIMB_LOWER_LEFT_FIN
-1, // GYORG_LIMB_JAW_ROOT
-1, // GYORG_LIMB_JAW
},
};
Vec3f D_809E9148 = { 600.0f, -100.0f, 0.0f };
@@ -2235,8 +2253,8 @@ void Boss03_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
Matrix_MultVec3f(&D_809E9148, &this->actor.focus.pos);
}
sphereElementIndex = sGyorgSphElementIndices[limbIndex];
if (sphereElementIndex >= 0) {
sphereElementIndex = sLimbToSphere[0][limbIndex];
if (sphereElementIndex > -1) {
Matrix_MultVec3f(&D_809E9154[sphereElementIndex], &spherePos);
if (sphereElementIndex < 2) {
+1 -1
View File
@@ -76,7 +76,7 @@ s32 func_80C1D4D0(DmAh* this, PlayState* play) {
this->unk_290 = CLAMP(this->unk_290, -0x1C70, 0x1C70);
if (this->unk_280->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_280)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_280)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_280->focus.pos);
}
+1 -1
View File
@@ -137,7 +137,7 @@ s32 func_80C1C62C(DmAn* this, PlayState* play) {
this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70);
if (this->unk_2B4->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos);
}
+1 -1
View File
@@ -137,7 +137,7 @@ s32 func_80C2457C(DmGm* this, PlayState* play) {
this->unk_2C4 = CLAMP(this->unk_2C4, -0x1C70, 0x1C70);
if (this->unk_2B4->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_2B4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_2B4->focus.pos);
}
+1 -1
View File
@@ -255,7 +255,7 @@ void func_80BD2DC8(EnAh* this) {
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
if (this->unk_1E4->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_1E4)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_1E4)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_1E4->focus.pos);
}
+1 -1
View File
@@ -540,7 +540,7 @@ void func_80BDED20(EnAl* this) {
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
if (this->unk_368->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_368)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_368)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_368->focus.pos);
}
+28 -24
View File
@@ -146,23 +146,6 @@ static Color_RGBA8 D_808B1120 = { 150, 150, 150, 255 };
static Color_RGBA8 D_808B1124 = { 100, 100, 100, 150 };
static Vec3f D_808B1128[] = {
{ 4700.0f, -500.0f, 1800.0f }, { 4700.0f, -500.0f, -1800.0f }, { 2000.0f, -1500.0f, 0.0f },
{ 2000.0f, 0.0f, -1500.0f }, { 2000.0f, 0.0f, 1500.0f },
};
static Vec3f D_808B1164[] = {
{ 0.0f, -3000.0f, 0.0f },
{ 700.0f, -800.0f, 0.0f },
};
static Vec3f D_808B117C[] = {
{ 800.0f, 1000.0f, -1000.0f },
{ 800.0f, 1000.0f, 1000.0f },
{ 800.0f, -1000.0f, 1000.0f },
{ 800.0f, -1000.0f, -1000.0f },
};
void EnAm_Init(Actor* thisx, PlayState* play) {
EnAm* this = THIS;
@@ -532,6 +515,26 @@ void EnAm_Update(Actor* thisx, PlayState* play) {
this->drawDmgEffScale = (this->drawDmgEffScale > 0.7f) ? 0.7f : this->drawDmgEffScale;
}
static Vec3f D_808B1128[] = {
{ 4700.0f, -500.0f, 1800.0f }, // ENAM_BODYPART_0
{ 4700.0f, -500.0f, -1800.0f }, // ENAM_BODYPART_1
{ 2000.0f, -1500.0f, 0.0f }, // ENAM_BODYPART_2
{ 2000.0f, 0.0f, -1500.0f }, // ENAM_BODYPART_3
{ 2000.0f, 0.0f, 1500.0f }, // ENAM_BODYPART_4
};
static Vec3f D_808B1164[] = {
{ 0.0f, -3000.0f, 0.0f }, // ENAM_BODYPART_5, ENAM_BODYPART_7
{ 700.0f, -800.0f, 0.0f }, // ENAM_BODYPART_6, ENAM_BODYPART_8
};
static Vec3f D_808B117C[] = {
{ 800.0f, 1000.0f, -1000.0f }, // ENAM_BODYPART_9
{ 800.0f, 1000.0f, 1000.0f }, // ENAM_BODYPART_10
{ 800.0f, -1000.0f, 1000.0f }, // ENAM_BODYPART_11
{ 800.0f, -1000.0f, -1000.0f }, // ENAM_BODYPART_12
};
void EnAm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
s32 i;
s32 phi_s3;
@@ -542,17 +545,18 @@ void EnAm_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
phi_s2 = 0;
phi_s1 = 0;
if (limbIndex == OBJECT_AM_LIMB_04) {
phi_s2 = &this->limbPos[0];
phi_s2 = &this->bodyPartsPos[ENAM_BODYPART_0];
phi_s1 = D_808B1128;
phi_s3 = 5;
phi_s3 = ARRAY_COUNT(D_808B1128);
} else if (limbIndex == OBJECT_AM_LIMB_0D) {
phi_s2 = &this->limbPos[9];
phi_s2 = &this->bodyPartsPos[ENAM_BODYPART_9];
phi_s1 = D_808B117C;
phi_s3 = 4;
phi_s3 = ARRAY_COUNT(D_808B117C);
} else if ((limbIndex == OBJECT_AM_LIMB_07) || (limbIndex == OBJECT_AM_LIMB_0A)) {
phi_s2 = (limbIndex == OBJECT_AM_LIMB_07) ? &this->limbPos[5] : &this->limbPos[7];
phi_s2 = (limbIndex == OBJECT_AM_LIMB_07) ? &this->bodyPartsPos[ENAM_BODYPART_5]
: &this->bodyPartsPos[ENAM_BODYPART_7];
phi_s1 = D_808B1164;
phi_s3 = 2;
phi_s3 = ARRAY_COUNT(D_808B1164);
} else {
phi_s3 = 0;
}
@@ -573,7 +577,7 @@ void EnAm_Draw(Actor* thisx, PlayState* play) {
POLY_OPA_DISP = &gfx[2];
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnAm_PostLimbDraw,
&this->actor);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale, 0.0f,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENAM_BODYPART_MAX, this->drawDmgEffScale, 0.0f,
this->drawDmgEffAlpha, ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
CLOSE_DISPS(play->state.gfxCtx);
+18 -1
View File
@@ -8,6 +8,23 @@ struct EnAm;
typedef void (*EnAmActionFunc)(struct EnAm*, PlayState*);
typedef enum EnAmBodyPart {
/* 0 */ ENAM_BODYPART_0,
/* 1 */ ENAM_BODYPART_1,
/* 2 */ ENAM_BODYPART_2,
/* 3 */ ENAM_BODYPART_3,
/* 4 */ ENAM_BODYPART_4,
/* 5 */ ENAM_BODYPART_5,
/* 6 */ ENAM_BODYPART_6,
/* 7 */ ENAM_BODYPART_7,
/* 8 */ ENAM_BODYPART_8,
/* 9 */ ENAM_BODYPART_9,
/* 10 */ ENAM_BODYPART_10,
/* 11 */ ENAM_BODYPART_11,
/* 12 */ ENAM_BODYPART_12,
/* 13 */ ENAM_BODYPART_MAX
} EnAmBodyPart;
typedef struct EnAm {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -22,7 +39,7 @@ typedef struct EnAm {
/* 0x240 */ f32 speed; // Hopping speed of Armos
/* 0x244 */ f32 drawDmgEffAlpha;
/* 0x248 */ f32 drawDmgEffScale;
/* 0x24C */ Vec3f limbPos[13];
/* 0x24C */ Vec3f bodyPartsPos[ENAM_BODYPART_MAX];
/* 0x2E8 */ ColliderCylinder enemyCollider; // Collider for when Armos is Hostile
/* 0x334 */ ColliderCylinder interactCollider; // Collider for when an interactable Armos is docile
} EnAm; // size = 0x380
+1 -1
View File
@@ -1450,7 +1450,7 @@ void func_80A97410(EnAz* this, PlayState* play) {
Math_SmoothStepToS(&this->unk_3D4, 0, 2, 0x71C, 0);
}
Math_Vec3f_Copy(&sp38, &player->actor.world.pos);
sp38.y = player->bodyPartsPos[7].y + 3.0f;
sp38.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
temp_v0_7 = Math_Vec3f_Pitch(&this->actor.focus.pos, &sp38);
if (ABS(temp_v0_7) < 0x800) {
Math_SmoothStepToS(&this->unk_3D6, temp_v0_7, 3, 0x71C, 0);
+6 -8
View File
@@ -363,8 +363,7 @@ void EnBat_Die(EnBat* this, PlayState* play) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->actor.floorHeight == BGCHECK_Y_MIN)) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartPoss, ARRAY_COUNT(this->bodyPartPoss), 2, 0.2f,
0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, BAD_BAT_BODYPART_MAX, 2, 0.2f, 0.2f);
}
func_800B3030(play, &this->actor.world.pos, &gZeroVec3f, &gZeroVec3f, 100, 0, 0);
@@ -552,13 +551,12 @@ void EnBat_Draw(Actor* thisx, PlayState* play) {
? (this->animationFrame * (15 * (0x10000 / 360))) - (120 * (0x10000 / 360))
: 0;
}
Matrix_MultZero(&this->bodyPartPoss[0]);
Matrix_MultZero(&this->bodyPartsPos[BAD_BAT_BODYPART_0]);
Matrix_RotateZS(rollAngle, MTXMODE_APPLY);
Matrix_MultVecX(1700.0f, &this->bodyPartPoss[1]);
Matrix_MultVecX(1700.0f, &this->bodyPartsPos[BAD_BAT_BODYPART_1]);
Matrix_RotateZS(-2 * rollAngle, MTXMODE_APPLY);
Matrix_MultVecX(-1700.0f, &this->bodyPartPoss[2]);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartPoss, ARRAY_COUNT(this->bodyPartPoss),
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha,
this->drawDmgEffType);
Matrix_MultVecX(-1700.0f, &this->bodyPartsPos[BAD_BAT_BODYPART_2]);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, BAD_BAT_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
}
}
+8 -1
View File
@@ -23,6 +23,13 @@ struct EnBat;
typedef void (*EnBatActionFunc)(struct EnBat*, PlayState*);
typedef enum BadBatBodyPart {
/* 0 */ BAD_BAT_BODYPART_0,
/* 1 */ BAD_BAT_BODYPART_1,
/* 2 */ BAD_BAT_BODYPART_2,
/* 3 */ BAD_BAT_BODYPART_MAX
} BadBatBodyPart;
typedef struct EnBat {
/* 0x000 */ Actor actor;
/* 0x144 */ EnBatActionFunc actionFunc;
@@ -36,7 +43,7 @@ typedef struct EnBat {
/* 0x154 */ f32 drawDmgEffScale;
/* 0x158 */ f32 drawDmgEffFrozenSteamScale;
/* 0x15C */ f32 drawDmgEffAlpha;
/* 0x160 */ Vec3f bodyPartPoss[3];
/* 0x160 */ Vec3f bodyPartsPos[BAD_BAT_BODYPART_MAX];
/* 0x184 */ ColliderSphere collider;
} EnBat; // size = 0x1DC
+44 -46
View File
@@ -119,37 +119,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP),
};
/**
* This maps a given limb based on its limbIndex to its appropriate index
* in the bodyPartsPos/Velocity arrays. An index of -1 indicates that the
* limb is not part of the bodyParts arrays.
*/
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
};
/**
* The last element of the bodyParts arrays is a duplicate of the cranium
* limb, which is then offset by a certain amount. There is no display list
* associated with this, so it is only used for effects.
*/
static Vec3f sDuplicateCraniumBodyPartOffset = { 1000.0f, -700.0f, 0.0f };
void EnBb_Init(Actor* thisx, PlayState* play) {
EnBb* this = THIS;
@@ -212,7 +181,7 @@ void EnBb_Thaw(EnBb* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.2f, 0.15f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, BUBBLE_BODYPART_MAX, 2, 0.2f, 0.15f);
this->actor.flags |= ACTOR_FLAG_200;
}
}
@@ -388,7 +357,7 @@ void EnBb_SetupDead(EnBb* this, PlayState* play) {
this->actor.gravity = -1.5f;
bodyPartVelocity = &this->bodyPartsVelocity[0];
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++, bodyPartVelocity++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++, bodyPartVelocity++) {
Math_Vec3f_Diff(&this->bodyPartsPos[i], &this->actor.world.pos, &posDiff);
magnitude = Math3D_Vec3fMagnitude(&posDiff);
if (magnitude > 1.0f) {
@@ -412,14 +381,14 @@ void EnBb_Dead(EnBb* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.z, 0x4000, 4, 0x1000, 0x400);
if (this->timer == 0) {
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++) {
func_800B3030(play, &this->bodyPartsPos[i], &gZeroVec3f, &gZeroVec3f, 40, 7, 2);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->bodyPartsPos[i], 11, NA_SE_EN_EXTINCT);
}
EnBb_SetupWaitForRevive(this);
} else {
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++) {
Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]);
this->bodyPartsVelocity[i].y += this->actor.gravity;
}
@@ -646,24 +615,54 @@ s32 EnBb_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
return false;
}
/**
* This maps a given limb based on its limbIndex to its appropriate index
* in the bodyPartsPos/Velocity arrays.
*/
static s8 sLimbToBodyParts[BUBBLE_LIMB_MAX] = {
BODYPART_NONE, // BUBBLE_LIMB_NONE
BODYPART_NONE, // BUBBLE_LIMB_ROOT
BODYPART_NONE, // BUBBLE_LIMB_CRANIUM_ROOT
BODYPART_NONE, // BUBBLE_LIMB_JAW_ROOT
BUBBLE_BODYPART_0, // BUBBLE_LIMB_JAW
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_ROOT
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_WRAPPER
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_WEBBING_ROOT
BUBBLE_BODYPART_1, // BUBBLE_LIMB_LEFT_WING_WEBBING
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_BONE
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_ROOT
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_WRAPPER
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_WEBBING_ROOT
BUBBLE_BODYPART_2, // BUBBLE_LIMB_RIGHT_WING_WEBBING
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_BONE
BUBBLE_BODYPART_3, // BUBBLE_LIMB_CRANIUM
};
/**
* The last element of the bodyParts arrays is a duplicate of the cranium
* limb, which is then offset by a certain amount. There is no display list
* associated with this, so it is only used for effects.
*/
static Vec3f sEffectsBodyPartOffset = { 1000.0f, -700.0f, 0.0f };
void EnBb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
s32 pad;
EnBb* this = THIS;
MtxF* currentMatrixState;
if (this->bodyPartDrawStatus == BB_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] == 0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
} else if (sLimbToBodyParts[limbIndex] == 3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
if (sLimbToBodyParts[limbIndex] == BUBBLE_BODYPART_0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[BUBBLE_BODYPART_0]);
} else if (sLimbToBodyParts[limbIndex] == BUBBLE_BODYPART_3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[BUBBLE_BODYPART_3]);
Matrix_MultVec3f(&sEffectsBodyPartOffset, &this->bodyPartsPos[BUBBLE_BODYPART_EFFECTS]);
} else {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
}
} else if (this->bodyPartDrawStatus > BB_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
@@ -671,7 +670,7 @@ void EnBb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
this->bodyPartDrawStatus = BB_BODY_PART_DRAW_STATUS_BROKEN;
}
} else {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
OPEN_DISPS(play->state.gfxCtx);
currentMatrixState = Matrix_GetCurrent();
@@ -717,9 +716,8 @@ void EnBb_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
}
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha,
this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, BUBBLE_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);
}
+11 -2
View File
@@ -10,6 +10,15 @@ struct EnBb;
typedef void (*EnBbActionFunc)(struct EnBb*, PlayState*);
typedef enum BubbleBodyPart {
/* 0 */ BUBBLE_BODYPART_0,
/* 1 */ BUBBLE_BODYPART_1,
/* 2 */ BUBBLE_BODYPART_2,
/* 3 */ BUBBLE_BODYPART_3,
/* 4 */ BUBBLE_BODYPART_EFFECTS,
/* 5 */ BUBBLE_BODYPART_MAX
} BubbleBodyPart;
typedef struct EnBb {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -31,8 +40,8 @@ typedef struct EnBb {
/* 0x26C */ f32 drawDmgEffAlpha;
/* 0x270 */ f32 drawDmgEffScale;
/* 0x274 */ f32 drawDmgEffFrozenSteamScale;
/* 0x278 */ Vec3f bodyPartsPos[5];
/* 0x2B4 */ Vec3f bodyPartsVelocity[5];
/* 0x278 */ Vec3f bodyPartsPos[BUBBLE_BODYPART_MAX];
/* 0x2B4 */ Vec3f bodyPartsVelocity[BUBBLE_BODYPART_MAX];
/* 0x2F0 */ Gfx* limbDList;
/* 0x2F4 */ ColliderSphere collider;
} EnBb; // size = 0x34C
@@ -253,12 +253,12 @@ void EnBba01_Update(Actor* thisx, PlayState* play) {
s32 EnBba01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnBba01* this = THIS;
s8 bodyPart;
s8 bodyPartIndex;
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
bodyPart = gEnHyBodyParts[limbIndex];
if (bodyPart >= 0) {
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
bodyPartIndex = gEnHyLimbToBodyParts[limbIndex];
if (bodyPartIndex > BODYPART_NONE) {
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPartIndex]);
}
if (limbIndex == BBA_LIMB_RIGHT_LOWER_ARM_ROOT) {
@@ -338,8 +338,8 @@ void EnBba01_Draw(Actor* thisx, PlayState* play) {
*shadowTexIter++ = 0;
}
for (i = 0; i < 5; i++) {
SubS_GenShadowTex(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f,
ARRAY_COUNT(this->enHy.bodyPartsPos), gEnHyShadowSizes, gEnHyParentBodyParts);
SubS_GenShadowTex(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f, ENHY_BODYPART_MAX,
gEnHyShadowSizes, gEnHyParentShadowBodyParts);
}
SubS_DrawShadowTex(&this->enHy.actor, &play->state, shadowTex);
+44 -46
View File
@@ -148,37 +148,6 @@ static InitChainEntry sInitChain[] = {
ICHAIN_F32(targetArrowOffset, 10, ICHAIN_STOP),
};
/**
* This maps a given limb based on its limbIndex to its appropriate index
* in the bodyPartsPos/Velocity arrays. An index of -1 indicates that the
* limb is not part of the bodyParts arrays.
*/
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
};
/**
* The last element of the bodyParts arrays is a duplicate of the cranium
* limb, which is then offset by a certain amount. There is no display list
* associated with this, so it is only used for effects.
*/
static Vec3f sDuplicateCraniumBodyPartOffset = { 1000.0f, -700.0f, 0.0f };
void EnBbfall_Init(Actor* thisx, PlayState* play) {
EnBbfall* this = THIS;
s32 i;
@@ -217,7 +186,7 @@ void EnBbfall_Thaw(EnBbfall* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.2f, 0.15f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, BUBBLE_BODYPART_MAX, 2, 0.2f, 0.15f);
this->actor.flags |= ACTOR_FLAG_200;
}
}
@@ -455,7 +424,7 @@ void EnBbfall_SetupDead(EnBbfall* this, PlayState* play) {
this->actor.gravity = -1.5f;
bodyPartVelocity = &this->bodyPartsVelocity[0];
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++, bodyPartVelocity++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++, bodyPartVelocity++) {
Math_Vec3f_Diff(&this->bodyPartsPos[i], &this->actor.world.pos, &posDiff);
magnitude = Math3D_Vec3fMagnitude(&posDiff);
if (magnitude > 1.0f) {
@@ -477,7 +446,7 @@ void EnBbfall_Dead(EnBbfall* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.world.rot.z, 0x4000, 4, 0x1000, 0x400);
if (this->timer == 0) {
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++) {
func_800B3030(play, &this->bodyPartsPos[i], &gZeroVec3f, &gZeroVec3f, 40, 7, 2);
SoundSource_PlaySfxAtFixedWorldPos(play, &this->bodyPartsPos[i], 11, NA_SE_EN_EXTINCT);
}
@@ -486,7 +455,7 @@ void EnBbfall_Dead(EnBbfall* this, PlayState* play) {
return;
}
for (i = 0; i < ARRAY_COUNT(this->bodyPartsPos); i++) {
for (i = 0; i < BUBBLE_BODYPART_MAX; i++) {
Math_Vec3f_Sum(&this->bodyPartsPos[i], &this->bodyPartsVelocity[i], &this->bodyPartsPos[i]);
this->bodyPartsVelocity[i].y += this->actor.gravity;
}
@@ -682,24 +651,54 @@ s32 EnBbfall_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
return false;
}
/**
* This maps a given limb based on its limbIndex to its appropriate index
* in the bodyPartsPos/Velocity arrays.
*/
static s8 sLimbToBodyParts[BUBBLE_LIMB_MAX] = {
BODYPART_NONE, // BUBBLE_LIMB_NONE
BODYPART_NONE, // BUBBLE_LIMB_ROOT
BODYPART_NONE, // BUBBLE_LIMB_CRANIUM_ROOT
BODYPART_NONE, // BUBBLE_LIMB_JAW_ROOT
BUBBLE_BODYPART_0, // BUBBLE_LIMB_JAW
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_ROOT
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_WRAPPER
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_WEBBING_ROOT
BUBBLE_BODYPART_1, // BUBBLE_LIMB_LEFT_WING_WEBBING
BODYPART_NONE, // BUBBLE_LIMB_LEFT_WING_BONE
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_ROOT
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_WRAPPER
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_WEBBING_ROOT
BUBBLE_BODYPART_2, // BUBBLE_LIMB_RIGHT_WING_WEBBING
BODYPART_NONE, // BUBBLE_LIMB_RIGHT_WING_BONE
BUBBLE_BODYPART_3, // BUBBLE_LIMB_CRANIUM
};
/**
* The last element of the bodyParts arrays is a duplicate of the cranium
* limb, which is then offset by a certain amount. There is no display list
* associated with this, so it is only used for effects.
*/
static Vec3f sEffectsBodyPartOffset = { 1000.0f, -700.0f, 0.0f };
void EnBbfall_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
s32 pad;
EnBbfall* this = THIS;
MtxF* currentMatrixState;
if (this->bodyPartDrawStatus == BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] == 0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[0]);
} else if (sLimbToBodyParts[limbIndex] == 3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[3]);
Matrix_MultVec3f(&sDuplicateCraniumBodyPartOffset, &this->bodyPartsPos[4]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
if (sLimbToBodyParts[limbIndex] == BUBBLE_BODYPART_0) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[BUBBLE_BODYPART_0]);
} else if (sLimbToBodyParts[limbIndex] == BUBBLE_BODYPART_3) {
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[BUBBLE_BODYPART_3]);
Matrix_MultVec3f(&sEffectsBodyPartOffset, &this->bodyPartsPos[BUBBLE_BODYPART_EFFECTS]);
} else {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
}
} else if (this->bodyPartDrawStatus > BBFALL_BODY_PART_DRAW_STATUS_ALIVE) {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
@@ -707,7 +706,7 @@ void EnBbfall_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* r
this->bodyPartDrawStatus = BBFALL_BODY_PART_DRAW_STATUS_BROKEN;
}
} else {
if (sLimbToBodyParts[limbIndex] != -1) {
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
OPEN_DISPS(play->state.gfxCtx);
currentMatrixState = Matrix_GetCurrent();
@@ -771,9 +770,8 @@ void EnBbfall_Draw(Actor* thisx, PlayState* play2) {
}
}
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha,
this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, BUBBLE_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);
}
@@ -3,6 +3,7 @@
#include "global.h"
#include "objects/object_bb/object_bb.h"
#include "overlays/actors/ovl_En_Bb/z_en_bb.h"
struct EnBbfall;
@@ -25,8 +26,8 @@ typedef struct EnBbfall {
/* 0x260 */ f32 drawDmgEffScale;
/* 0x264 */ f32 drawDmgEffFrozenSteamScale;
/* 0x268 */ Vec3f flamePos[6];
/* 0x2B0 */ Vec3f bodyPartsPos[5];
/* 0x2EC */ Vec3f bodyPartsVelocity[5];
/* 0x2B0 */ Vec3f bodyPartsPos[BUBBLE_BODYPART_MAX];
/* 0x2EC */ Vec3f bodyPartsVelocity[BUBBLE_BODYPART_MAX];
/* 0x328 */ Gfx* limbDList;
/* 0x32C */ UNK_TYPE1 unk_32C[0x58];
/* 0x384 */ ColliderJntSph collider;
@@ -372,7 +372,7 @@ void EnBigokuta_PlayDeathCutscene(EnBigokuta* this, PlayState* play) {
if (this->timer == 0) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->picto.actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.5f, 0.35f);
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, BIGOKUTA_BODYPART_MAX, 2, 0.5f, 0.35f);
EnBigokuta_SetupDeathEffects(this);
}
} else if (CutsceneManager_IsNext(this->csId)) {
@@ -628,31 +628,34 @@ s32 EnBigokuta_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
}
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
BODYPART_NONE, // BIGOKUTA_LIMB_NONE
BODYPART_NONE, // BIGOKUTA_LIMB_BODY
BODYPART_NONE, // BIGOKUTA_LIMB_RIGHT_FRONT_ARM_BASE
BIGOKUTA_BODYPART_0, // BIGOKUTA_LIMB_RIGHT_FRONT_ARM_END
BODYPART_NONE, // BIGOKUTA_LIMB_LEFT_FRONT_ARM_BASE
BIGOKUTA_BODYPART_1, // BIGOKUTA_LIMB_LEFT_FRONT_ARM_END
BODYPART_NONE, // BIGOKUTA_LIMB_RIGHT_BACK_ARM_BASE
BIGOKUTA_BODYPART_2, // BIGOKUTA_LIMB_RIGHT_BACK_ARM_END
BODYPART_NONE, // BIGOKUTA_LIMB_LEFT_BACK_ARM_BASE
BIGOKUTA_BODYPART_3, // BIGOKUTA_LIMB_LEFT_BACK_ARM_END
BIGOKUTA_BODYPART_8, // BIGOKUTA_LIMB_HEAD
BIGOKUTA_BODYPART_4, // BIGOKUTA_LIMB_LEFT_TENTACLE_BASE
BODYPART_NONE, // BIGOKUTA_LIMB_LEFT_TENTACLE_TIP
BIGOKUTA_BODYPART_5, // BIGOKUTA_LIMB_RIGHT_TENTACLE_BASE
BODYPART_NONE, // BIGOKUTA_LIMB_RIGHT_TENTACLE_TIP
BODYPART_NONE, // BIGOKUTA_LIMB_LEFT_WEAK_POINT
BODYPART_NONE, // BIGOKUTA_LIMB_RIGHT_WEAK_POINT
BODYPART_NONE, // BIGOKUTA_LIMB_CENTER_SNOUT
BIGOKUTA_BODYPART_6, // BIGOKUTA_LIMB_RIGHT_SNOUT
BIGOKUTA_BODYPART_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 },
{ 0.0f, 2000.0f, 1000.0f }, // BIGOKUTA_BODYPART_8
{ 0.0f, 2000.0f, -2000.0f }, // BIGOKUTA_BODYPART_9
{ 1700.0f, 700.0f, -600.0f }, // BIGOKUTA_BODYPART_10
{ -1700.0f, 700.0f, -600.0f }, // BIGOKUTA_BODYPART_11
{ 0.0f, 500.0f, -2500.0f }, // BIGOKUTA_BODYPART_12
};
void EnBigokuta_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
@@ -660,14 +663,14 @@ void EnBigokuta_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
s32 i;
s8 bodyPartIndex = sLimbToBodyParts[limbIndex];
if (bodyPartIndex != -1) {
if (bodyPartIndex < 6) {
Matrix_MultVecX(800.0f, &this->limbPos[bodyPartIndex]);
} else if (bodyPartIndex < 8) {
Matrix_MultZero(&this->limbPos[bodyPartIndex]);
if (bodyPartIndex != BODYPART_NONE) {
if (bodyPartIndex <= BIGOKUTA_BODYPART_5) {
Matrix_MultVecX(800.0f, &this->bodyPartsPos[bodyPartIndex]);
} else if (bodyPartIndex <= BIGOKUTA_BODYPART_7) {
Matrix_MultZero(&this->bodyPartsPos[bodyPartIndex]);
} else {
for (i = 0; i < ARRAY_COUNT(D_80AC45D0); i++) {
Matrix_MultVec3f(&D_80AC45D0[i], &this->limbPos[bodyPartIndex + i]);
Matrix_MultVec3f(&D_80AC45D0[i], &this->bodyPartsPos[bodyPartIndex + i]);
}
}
}
@@ -698,7 +701,7 @@ void EnBigokuta_Draw(Actor* thisx, PlayState* play) {
NULL, EnBigokuta_PostLimbDraw, &this->picto.actor, &gfx[2]);
}
Actor_DrawDamageEffects(play, &this->picto.actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->picto.actor, this->bodyPartsPos, BIGOKUTA_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);
@@ -9,6 +9,23 @@ struct EnBigokuta;
typedef void (*EnBigokutaActionFunc)(struct EnBigokuta*, PlayState*);
typedef enum BigokutaBodyPart {
/* 0 */ BIGOKUTA_BODYPART_0,
/* 1 */ BIGOKUTA_BODYPART_1,
/* 2 */ BIGOKUTA_BODYPART_2,
/* 3 */ BIGOKUTA_BODYPART_3,
/* 4 */ BIGOKUTA_BODYPART_4,
/* 5 */ BIGOKUTA_BODYPART_5,
/* 6 */ BIGOKUTA_BODYPART_6,
/* 7 */ BIGOKUTA_BODYPART_7,
/* 8 */ BIGOKUTA_BODYPART_8,
/* 9 */ BIGOKUTA_BODYPART_9,
/* 10 */ BIGOKUTA_BODYPART_10,
/* 11 */ BIGOKUTA_BODYPART_11,
/* 12 */ BIGOKUTA_BODYPART_12,
/* 13 */ BIGOKUTA_BODYPART_MAX
} BigokutaBodyPart;
typedef struct EnBigokuta {
/* 0x000 */ PictoActor picto;
/* 0x148 */ SkelAnime skelAnime;
@@ -26,7 +43,7 @@ typedef struct EnBigokuta {
/* 0x2A0 */ Vec3f playerHoldPos;
/* 0x2AC */ Vec3f subCamAt;
/* 0x2B8 */ Vec3f subCamEye;
/* 0x2C4 */ Vec3f limbPos[13];
/* 0x2C4 */ Vec3f bodyPartsPos[BIGOKUTA_BODYPART_MAX];
/* 0x360 */ ColliderCylinder shellCollider;
/* 0x3AC */ ColliderCylinder bodyCollider;
} EnBigokuta; // size = 0x3F8
+26 -25
View File
@@ -160,24 +160,24 @@ static InitChainEntry sInitChain[] = {
// used in the burning death actionfunc
static Vec3f D_80B6506C = { 0.0f, 3.0f, 0.0f };
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
static s8 sLimbToBodyParts[BIG_POE_LIMB_MAX] = {
BODYPART_NONE, // BIG_POE_LIMB_NONE
BIG_POE_BODYPART_4, // BIG_POE_LIMB_FACE
BODYPART_NONE, // BIG_POE_LIMB_LEFT_UPPER_ARM
BIG_POE_BODYPART_0, // BIG_POE_LIMB_LEFT_FOREARM
BODYPART_NONE, // BIG_POE_LIMB_RIGHT_UPPER_ARM
BIG_POE_BODYPART_1, // BIG_POE_LIMB_RIGHT_FOREARM
BODYPART_NONE, // BIG_POE_LIMB_RIGHT_HAND
BIG_POE_BODYPART_2, // BIG_POE_LIMB_LANTERN
BIG_POE_BODYPART_5, // BIG_POE_LIMB_HAT_AND_CLOAK
BIG_POE_BODYPART_3, // BIG_POE_LIMB_LOWER_ROBE
};
// used in limbdraw
static Vec3f D_80B65084[] = {
{ 2000.0f, 4000.0f, 0.0f },
{ -1000.0f, 1500.0f, -2000.0f },
{ -1000.0f, 1500.0f, 2000.0f },
{ 2000.0f, 4000.0f, 0.0f }, // BIG_POE_BODYPART_6
{ -1000.0f, 1500.0f, -2000.0f }, // BIG_POE_BODYPART_7
{ -1000.0f, 1500.0f, 2000.0f }, // BIG_POE_BODYPART_8
};
void EnBigpo_Init(Actor* thisx, PlayState* play2) {
@@ -1267,19 +1267,20 @@ void EnBigpo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* ro
}
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]);
if (bodyPartIndex != BODYPART_NONE) {
if (bodyPartIndex <= BIG_POE_BODYPART_2) {
Matrix_MultZero(&this->bodyPartsPos[bodyPartIndex]);
} else if (bodyPartIndex == BIG_POE_BODYPART_3) {
Matrix_MultVecX(3000.0f, &this->bodyPartsPos[bodyPartIndex]);
} else if (bodyPartIndex == BIG_POE_BODYPART_4) {
Matrix_MultVecY(-2000.0f, &this->bodyPartsPos[bodyPartIndex]);
} else {
v2ptr = &this->limbPos[bodyPartIndex + 1];
v2ptr = &this->bodyPartsPos[bodyPartIndex + 1];
v1ptr = D_80B65084;
Matrix_MultVecX(-4000.0f, &this->limbPos[bodyPartIndex]);
// BIG_POE_BODYPART_5
Matrix_MultVecX(-4000.0f, &this->bodyPartsPos[bodyPartIndex]);
for (i = bodyPartIndex + 1; i < ARRAY_COUNT(this->limbPos); i++) {
for (i = bodyPartIndex + 1; i < BIG_POE_BODYPART_MAX; i++) {
Matrix_MultVec3f(v1ptr, v2ptr);
v2ptr++;
v1ptr++;
@@ -1318,7 +1319,7 @@ void EnBigpo_DrawMainBigpo(Actor* thisx, PlayState* play) {
}
// 71.428566f might be 500/7 context unknown
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, BIG_POE_BODYPART_MAX,
this->actor.scale.x * 71.428566f * this->drawDmgEffScale, 0.0f, this->drawDmgEffAlpha,
ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
+14 -1
View File
@@ -8,6 +8,19 @@ struct EnBigpo;
typedef void (*EnBigPoActionFunc)(struct EnBigpo*, PlayState*);
typedef enum BigPoeBodyPart {
/* 0 */ BIG_POE_BODYPART_0,
/* 1 */ BIG_POE_BODYPART_1,
/* 2 */ BIG_POE_BODYPART_2,
/* 3 */ BIG_POE_BODYPART_3,
/* 4 */ BIG_POE_BODYPART_4,
/* 5 */ BIG_POE_BODYPART_5,
/* 6 */ BIG_POE_BODYPART_6,
/* 7 */ BIG_POE_BODYPART_7,
/* 8 */ BIG_POE_BODYPART_8,
/* 9 */ BIG_POE_BODYPART_MAX
} BigPoeBodyPart;
typedef struct EnBigpoFireEffect {
/* 0x00 */ Vec3f pos;
/* 0x0C */ LightNode* light;
@@ -40,7 +53,7 @@ typedef struct EnBigpo {
/* 0x218 */ f32 savedHeight; // actual height while flying moves as part of bobbing
/* 0x21C */ f32 drawDmgEffAlpha;
/* 0x220 */ f32 drawDmgEffScale;
/* 0x224 */ Vec3f limbPos[9];
/* 0x224 */ Vec3f bodyPartsPos[BIG_POE_BODYPART_MAX];
/* 0x290 */ Color_RGBA8 mainColor;
/* 0x294 */ Color_RGBA8 lanternColor;
/* 0x298 */ UNK_TYPE1 pad298[0x14];
@@ -923,7 +923,7 @@ void EnBigslime_GekkoThaw(EnBigslime* this, PlayState* play) {
this->gekkoCollider.base.colType = COLTYPE_HIT6;
this->gekkoCollider.info.elemType = ELEMTYPE_UNK1;
this->gekkoDrawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->gekkoBodyPartsPos, GEKKO_BODYPART_MAX, 2, 0.3f, 0.2f);
this->actor.flags |= ACTOR_FLAG_200;
}
}
@@ -3034,30 +3034,30 @@ void EnBigslime_DrawBigslime(Actor* thisx, PlayState* 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
BODYPART_NONE, // GEKKO_LIMB_NONE
BODYPART_NONE, // GEKKO_LIMB_ROOT
GEKKO_BODYPART_WAIST, // GEKKO_LIMB_WAIST
BODYPART_NONE, // GEKKO_LIMB_LEFT_THIGH
GEKKO_BODYPART_LEFT_SHIN, // GEKKO_LIMB_LEFT_SHIN
BODYPART_NONE, // GEKKO_LIMB_LEFT_ANKLE
GEKKO_BODYPART_LEFT_FOOT, // GEKKO_LIMB_LEFT_FOOT
BODYPART_NONE, // GEKKO_LIMB_RIGHT_THIGH
GEKKO_BODYPART_RIGHT_SHIN, // GEKKO_LIMB_RIGHT_SHIN
BODYPART_NONE, // GEKKO_LIMB_RIGHT_ANKLE
GEKKO_BODYPART_RIGHT_FOOT, // GEKKO_LIMB_RIGHT_FOOT
BODYPART_NONE, // GEKKO_LIMB_TORSO
GEKKO_BODYPART_LEFT_UPPER_ARM, // GEKKO_LIMB_LEFT_UPPER_ARM
GEKKO_BODYPART_LEFT_FOREARM, // GEKKO_LIMB_LEFT_FOREARM
BODYPART_NONE, // GEKKO_LIMB_LEFT_WRIST
GEKKO_BODYPART_LEFT_HAND, // GEKKO_LIMB_LEFT_HAND
GEKKO_BODYPART_RIGHT_UPPER_ARM, // GEKKO_LIMB_RIGHT_UPPER_ARM
GEKKO_BODYPART_RIGHT_FOREARM, // GEKKO_LIMB_RIGHT_FOREARM
BODYPART_NONE, // GEKKO_LIMB_RIGHT_WRIST
GEKKO_BODYPART_RIGHT_HAND, // GEKKO_LIMB_RIGHT_HAND
BODYPART_NONE, // GEKKO_LIMB_HEAD
GEKKO_BODYPART_JAW, // GEKKO_LIMB_JAW
BODYPART_NONE, // GEKKO_LIMB_LEFT_EYE
BODYPART_NONE, // GEKKO_LIMB_RIGHT_EYE
};
// Some kind of offset for the position of the Gekkos right foot
@@ -3072,8 +3072,8 @@ void EnBigslime_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
this->actor.focus.rot.y = this->gekkoRot.y;
}
if (sLimbToBodyParts[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[sLimbToBodyParts[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->gekkoBodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == GEKKO_LIMB_RIGHT_ANKLE) {
@@ -3130,7 +3130,7 @@ void EnBigslime_DrawGekko(Actor* thisx, PlayState* play) {
EnBigslime_DrawShatteringEffects(this, play);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->gekkoBodyPartsPos, GEKKO_BODYPART_MAX,
this->gekkoScale * (999.99991f / 7.0f) * this->gekkoDrawDmgEffScale,
this->gekkoDrawDmgEffFrozenSteamScale, this->gekkoDrawDmgEffAlpha,
this->gekkoDrawDmgEffType);
@@ -106,7 +106,7 @@ typedef struct EnBigslime {
Vec3f frozenPos;
Vec3f subCamDistToFrog; // Used to zoom into frogs as Gekko despawns/Frog spawns
};
/* 0x02F8 */ Vec3f limbPos[12];
/* 0x02F8 */ Vec3f gekkoBodyPartsPos[GEKKO_BODYPART_MAX];
/* 0x0388 */ f32 gekkoDrawDmgEffAlpha;
/* 0x038C */ f32 gekkoDrawDmgEffScale;
/* 0x0390 */ f32 gekkoDrawDmgEffFrozenSteamScale;
+1 -1
View File
@@ -423,7 +423,7 @@ void func_80868B74(EnBox* this, PlayState* play) {
this->dyna.actor.world.pos.y += 1.25f;
}
this->unk_1A0++;
if ((this->csId1 != -1) && CutsceneManager_GetCurrentCsId() == this->csId1) {
if ((this->csId1 != CS_ID_NONE) && (CutsceneManager_GetCurrentCsId() == this->csId1)) {
if (this->unk_1A0 == 2) {
func_800B724C(play, &this->dyna.actor, PLAYER_CSMODE_4);
} else if (this->unk_1A0 == 22) {
@@ -240,12 +240,12 @@ void EnCne01_Update(Actor* thisx, PlayState* play) {
s32 EnCne01_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnCne01* this = THIS;
s8 bodyPart;
s8 bodyPartIndex;
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
bodyPart = gEnHyBodyParts[limbIndex];
if (bodyPart >= 0) {
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPart]);
bodyPartIndex = gEnHyLimbToBodyParts[limbIndex];
if (bodyPartIndex > BODYPART_NONE) {
Matrix_MultVec3f(&zeroVec, &this->enHy.bodyPartsPos[bodyPartIndex]);
}
if (limbIndex == CNE_LIMB_HEAD) {
@@ -327,8 +327,8 @@ void EnCne01_Draw(Actor* thisx, PlayState* play) {
*shadowTexIter++ = 0;
}
for (i = 0; i < 5; i++) {
SubS_GenShadowTex(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f,
ARRAY_COUNT(this->enHy.bodyPartsPos), gEnHyShadowSizes, gEnHyParentBodyParts);
SubS_GenShadowTex(this->enHy.bodyPartsPos, &this->enHy.actor.world.pos, shadowTex, i / 5.0f, ENHY_BODYPART_MAX,
gEnHyShadowSizes, gEnHyParentShadowBodyParts);
}
SubS_DrawShadowTex(&this->enHy.actor, &play->state, shadowTex);
+3 -3
View File
@@ -290,7 +290,7 @@ void EnCrow_CheckIfFrozen(EnCrow* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, 4, 2, 0.2f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, GUAY_BODYPART_MAX, 2, 0.2f, 0.2f);
}
}
@@ -565,7 +565,7 @@ void EnCrow_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
EnCrow* this = THIS;
if (limbIndex == OBJECT_CROW_LIMB_BODY) {
Matrix_MultVecX(2500.0f, this->bodyPartsPos);
Matrix_MultVecX(2500.0f, &this->bodyPartsPos[GUAY_BODYPART_BODY]);
} else if ((limbIndex == OBJECT_CROW_LIMB_RIGHT_WING_TIP) || (limbIndex == OBJECT_CROW_LIMB_LEFT_WING_TIP) ||
(limbIndex == OBJECT_CROW_LIMB_TAIL)) {
Matrix_MultZero(&this->bodyPartsPos[(limbIndex >> 1) - 1]);
@@ -578,7 +578,7 @@ void EnCrow_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnCrow_OverrideLimbDraw, EnCrow_PostLimbDraw, &this->actor);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, GUAY_BODYPART_MAX,
this->actor.scale.x * 100.0f * this->drawDmgEffFrozenSteamScale, this->drawDmgEffScale,
this->drawDmgEffAlpha, this->drawDmgEffType);
}
+9 -1
View File
@@ -13,6 +13,14 @@ struct EnCrow;
typedef void (*EnCrowActionFunc)(struct EnCrow*, PlayState*);
typedef enum GuayBodyPart {
/* 0 */ GUAY_BODYPART_BODY,
/* 1 */ GUAY_BODYPART_RIGHT_WING_TIP,
/* 2 */ GUAY_BODYPART_LEFT_WING_TIP,
/* 3 */ GUAY_BODYPART_TAIL,
/* 4 */ GUAY_BODYPART_MAX
} GuayBodyPart;
typedef struct EnCrow {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -25,7 +33,7 @@ typedef struct EnCrow {
/* 0x1CA */ Vec3s morphTable[OBJECT_CROW_LIMB_MAX];
/* 0x200 */ ColliderJntSph collider;
/* 0x220 */ ColliderJntSphElement colliderItems[1];
/* 0x260 */ Vec3f bodyPartsPos[4];
/* 0x260 */ Vec3f bodyPartsPos[GUAY_BODYPART_MAX];
/* 0x290 */ f32 drawDmgEffAlpha;
/* 0x294 */ f32 drawDmgEffFrozenSteamScale;
/* 0x298 */ f32 drawDmgEffScale;
@@ -301,8 +301,8 @@ void EnDekubaba_SpawnIceEffects(EnDekubaba* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->collider.base.colType = COLTYPE_HIT6;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 4,
this->size * 0.3f, this->size * 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DEKUBABA_BODYPART_MAX, 4, this->size * 0.3f,
this->size * 0.2f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -1237,7 +1237,7 @@ void EnDekubaba_DrawStemRetracted(EnDekubaba* this, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemTopDL);
for (i = 1; i < ARRAY_COUNT(this->bodyPartsPos); i++) {
for (i = DEKUBABA_BODYPART_1; i < DEKUBABA_BODYPART_MAX; i++) {
Matrix_MultZero(&this->bodyPartsPos[i]);
}
@@ -1293,7 +1293,7 @@ void EnDekubaba_DrawStemExtended(EnDekubaba* this, PlayState* play) {
}
}
Matrix_MultZero(&this->bodyPartsPos[i + 1]);
Matrix_MultZero(&this->bodyPartsPos[DEKUBABA_BODYPART_1 + i]);
}
CLOSE_DISPS(play->state.gfxCtx);
@@ -1309,7 +1309,7 @@ void EnDekubaba_DrawStemBasePruned(EnDekubaba* this, PlayState* play) {
Collider_UpdateSpheres(55, &this->collider);
Collider_UpdateSpheres(56, &this->collider);
Matrix_MultZero(&this->bodyPartsPos[3]);
Matrix_MultZero(&this->bodyPartsPos[DEKUBABA_BODYPART_3]);
CLOSE_DISPS(play->state.gfxCtx);
}
@@ -1349,7 +1349,7 @@ void EnDekubaba_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
Math_Vec3f_Copy(&this->bodyPartsPos[0], &this->actor.world.pos);
Math_Vec3f_Copy(&this->bodyPartsPos[DEKUBABA_BODYPART_0], &this->actor.world.pos);
if (this->actionFunc != EnDekubaba_DeadStickDrop) {
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnDekubaba_PostLimbDraw,
@@ -1382,7 +1382,7 @@ void EnDekubaba_Draw(Actor* thisx, PlayState* play) {
}
CLOSE_DISPS(play->state.gfxCtx);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, DEKUBABA_BODYPART_MAX,
this->drawDmgEffScale * this->size, this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha,
this->drawDmgEffType);
}
@@ -13,6 +13,14 @@ typedef enum {
/* 1 */ DEKUBABA_BIG
} DekuBabaType;
typedef enum DekuBabaBodyPart {
/* 0 */ DEKUBABA_BODYPART_0,
/* 1 */ DEKUBABA_BODYPART_1,
/* 2 */ DEKUBABA_BODYPART_2,
/* 3 */ DEKUBABA_BODYPART_3,
/* 4 */ DEKUBABA_BODYPART_MAX
} DekuBabaBodyPart;
typedef struct EnDekubaba {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -27,7 +35,7 @@ typedef struct EnDekubaba {
/* 0x1FC */ f32 drawDmgEffAlpha;
/* 0x200 */ f32 drawDmgEffScale;
/* 0x204 */ f32 drawDmgEffFrozenSteamScale;
/* 0x208 */ Vec3f bodyPartsPos[4];
/* 0x208 */ Vec3f bodyPartsPos[DEKUBABA_BODYPART_MAX];
/* 0x238 */ CollisionPoly* boundFloor;
/* 0x23C */ ColliderJntSph collider;
/* 0x25C */ ColliderJntSphElement colliderElements[7];
@@ -162,7 +162,7 @@ void func_808BD3B4(EnDekunuts* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->collider.base.colType = COLTYPE_HIT6;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, 8, 2, 0.2f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ENDEKUNUTS_BODYPART_MAX, 2, 0.2f, 0.2f);
}
}
@@ -700,28 +700,42 @@ s32 EnDekunuts_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
return false;
}
static s8 sLimbToBodyParts[DEKU_SCRUB_LIMB_MAX] = {
BODYPART_NONE, // DEKU_SCRUB_LIMB_NONE
BODYPART_NONE, // DEKU_SCRUB_LIMB_BODY
BODYPART_NONE, // DEKU_SCRUB_LIMB_HEAD
ENDEKUNUTS_BODYPART_3, // DEKU_SCRUB_LIMB_HEADDRESS
BODYPART_NONE, // DEKU_SCRUB_LIMB_CREST
ENDEKUNUTS_BODYPART_0, // DEKU_SCRUB_LIMB_SNOUT
BODYPART_NONE, // DEKU_SCRUB_LIMB_LEFT_LEG
ENDEKUNUTS_BODYPART_1, // DEKU_SCRUB_LIMB_LEFT_FOOT
BODYPART_NONE, // DEKU_SCRUB_LIMB_RIGHT_LEG
ENDEKUNUTS_BODYPART_2, // DEKU_SCRUB_LIMB_RIGHT_FOOT
};
static Vec3f D_808BEFA4[] = {
{ -1500.0f, 0.0f, -1700.0f }, // ENDEKUNUTS_BODYPART_4
{ -1500.0f, 0.0f, 1700.0f }, // ENDEKUNUTS_BODYPART_5
{ -2500.0f, -2000.0f, 0.0f }, // ENDEKUNUTS_BODYPART_6
{ -1000.0f, 1000.0f, 0.0f }, // ENDEKUNUTS_BODYPART_7
};
void EnDekunuts_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static s8 D_808BEF98[] = {
-1, -1, -1, 3, -1, 0, -1, 1, -1, 2, 0, 0,
};
static Vec3f D_808BEFA4[] = {
{ -1500.0f, 0.0f, -1700.0f }, { -1500.0f, 0.0f, 1700.0f }, { -2500.0f, -2000.0f, 0.0f },
{ -1000.0f, 1000.0f, 0.0f }, { 0.0f, 0.0f, 0.0f },
};
EnDekunuts* this = THIS;
s32 i;
Vec3f* ptr1;
Vec3f* ptr2;
s32 value = D_808BEF98[limbIndex];
s32 bodyPartIndex = sLimbToBodyParts[limbIndex];
if (value != -1) {
if (value < 3) {
Matrix_MultVecX(1000.0f, &this->limbPos[value]);
if (bodyPartIndex != BODYPART_NONE) {
if (bodyPartIndex <= ENDEKUNUTS_BODYPART_2) {
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[bodyPartIndex]);
} else {
Matrix_MultZero(&this->limbPos[value]);
// ENDEKUNUTS_BODYPART_3
Matrix_MultZero(&this->bodyPartsPos[bodyPartIndex]);
ptr1 = &D_808BEFA4[0];
ptr2 = &this->limbPos[value + 1];
for (i = value + 1; i < ARRAY_COUNT(this->limbPos); i++) {
ptr2 = &this->bodyPartsPos[bodyPartIndex + 1];
for (i = bodyPartIndex + 1; i < ENDEKUNUTS_BODYPART_MAX; i++) {
Matrix_MultVec3f(ptr1, ptr2);
ptr1++, ptr2++;
}
@@ -745,6 +759,6 @@ void EnDekunuts_Draw(Actor* thisx, PlayState* play) {
func_800AE5A0(play);
}
Gfx_DrawDListOpa(play, gDekuScrubFlowerDL);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENDEKUNUTS_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
}
@@ -17,6 +17,18 @@ typedef enum {
/* 0xFF */ ENDEKUNUTS_GET_FF00_FF = 0xFF
} EnDekunutsParam;
typedef enum DekunutsBodyPart {
/* 0 */ ENDEKUNUTS_BODYPART_0,
/* 1 */ ENDEKUNUTS_BODYPART_1,
/* 2 */ ENDEKUNUTS_BODYPART_2,
/* 3 */ ENDEKUNUTS_BODYPART_3,
/* 4 */ ENDEKUNUTS_BODYPART_4,
/* 5 */ ENDEKUNUTS_BODYPART_5,
/* 6 */ ENDEKUNUTS_BODYPART_6,
/* 7 */ ENDEKUNUTS_BODYPART_7,
/* 8 */ ENDEKUNUTS_BODYPART_MAX
} DekunutsBodyPart;
typedef struct EnDekunuts {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -32,7 +44,7 @@ typedef struct EnDekunuts {
/* 0x210 */ f32 drawDmgEffAlpha;
/* 0x214 */ f32 drawDmgEffScale;
/* 0x218 */ f32 drawDmgEffFrozenSteamScale;
/* 0x21C */ Vec3f limbPos[8];
/* 0x21C */ Vec3f bodyPartsPos[ENDEKUNUTS_BODYPART_MAX];
/* 0x27C */ ColliderCylinder collider;
} EnDekunuts; // size = 0x2C8
@@ -390,7 +390,7 @@ void func_8089ACEC(EnDinofos* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->colliderJntSph.base.colType = COLTYPE_HIT0;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, 12, 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DINOFOS_BODYPART_MAX, 2, 0.3f, 0.2f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -1048,9 +1048,9 @@ void func_8089CB10(EnDinofos* this, PlayState* play) {
for (i = 6; i < ARRAY_COUNT(this->colliderJntSphElement); i++) {
worldSphere = &this->colliderJntSph.elements[i].dim.worldSphere;
worldSphere->center.x = this->limbPos[10].x;
worldSphere->center.y = this->limbPos[10].y;
worldSphere->center.z = this->limbPos[10].z;
worldSphere->center.x = this->bodyPartsPos[DINOFOS_BODYPART_JAW].x;
worldSphere->center.y = this->bodyPartsPos[DINOFOS_BODYPART_JAW].y;
worldSphere->center.z = this->bodyPartsPos[DINOFOS_BODYPART_JAW].z;
}
if (play->sceneId == SCENE_MITURIN) {
@@ -1086,7 +1086,8 @@ void func_8089CBEC(EnDinofos* this, PlayState* play) {
sp7C.y = Rand_CenteredFloat(0.6f) + 1.4f;
sp7C.z = 0.9f * temp_f22;
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
EffectSsDFire_Spawn(play, &this->limbPos[10], &sp88, &sp7C, 30, 22, 255 - (temp_s0 * 20), 20, 3, 8);
EffectSsDFire_Spawn(play, &this->bodyPartsPos[DINOFOS_BODYPART_JAW], &sp88, &sp7C, 30, 22, 255 - (temp_s0 * 20), 20,
3, 8);
for (end = 6, i = 3; i > 0; i--) {
if (this->unk_290 < (20 + -(i * 2))) {
@@ -1099,9 +1100,11 @@ void func_8089CBEC(EnDinofos* this, PlayState* play) {
dim = &this->colliderJntSph.elements[i].dim;
temp_s3 = (s32)(Math_CosF((this->unk_290 + ((i - 5) << 1)) * (M_PI / 20)) * 0x2C00) + this->actor.shape.rot.y;
dim->worldSphere.center.x = (s32)this->limbPos[10].x + (s32)(Math_SinS(temp_s3) * dim->modelSphere.center.z);
dim->worldSphere.center.y = (s32)this->limbPos[10].y + (s32)dim->modelSphere.center.y;
dim->worldSphere.center.z = (s32)this->limbPos[10].z + (s32)(Math_CosS(temp_s3) * dim->modelSphere.center.z);
dim->worldSphere.center.x =
(s32)this->bodyPartsPos[DINOFOS_BODYPART_JAW].x + (s32)(Math_SinS(temp_s3) * dim->modelSphere.center.z);
dim->worldSphere.center.y = (s32)this->bodyPartsPos[DINOFOS_BODYPART_JAW].y + (s32)dim->modelSphere.center.y;
dim->worldSphere.center.z =
(s32)this->bodyPartsPos[DINOFOS_BODYPART_JAW].z + (s32)(Math_CosS(temp_s3) * dim->modelSphere.center.z);
}
if (this->unk_290 != 0) {
@@ -1345,7 +1348,7 @@ void EnDinofos_Update(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
EnDinofos* this = THIS;
s32 pad;
Vec3f sp30;
Vec3f bodyPartPos;
if (this->actionFunc != func_8089C7B8) {
func_8089A900(this);
@@ -1362,10 +1365,11 @@ void EnDinofos_Update(Actor* thisx, PlayState* play2) {
UPDBGCHECKINFO_FLAG_10 | UPDBGCHECKINFO_FLAG_40);
if (this->actionFunc != func_8089C7B8) {
if ((this->actor.depthInWater > 0.0f) && (this->actor.depthInWater < 10.0f)) {
if (!((play->gameplayFrames % 4) & 1)) {
Math_Vec3f_Copy(&sp30, &this->limbPos[1 + (play->gameplayFrames % 4)]);
sp30.y = this->actor.world.pos.y + this->actor.depthInWater;
EffectSsGRipple_Spawn(play, &sp30, 100, 320, 0);
if (((play->gameplayFrames % 4) & 1) == 0) {
Math_Vec3f_Copy(&bodyPartPos,
&this->bodyPartsPos[DINOFOS_BODYPART_LEFT_CLAWS + (play->gameplayFrames % 4)]);
bodyPartPos.y = this->actor.world.pos.y + this->actor.depthInWater;
EffectSsGRipple_Spawn(play, &bodyPartPos, 100, 320, 0);
}
}
if (this->actionFunc != func_8089D018) {
@@ -1377,7 +1381,7 @@ void EnDinofos_Update(Actor* thisx, PlayState* play2) {
Math_ScaledStepToS(&this->unk_28E, 0, 2000);
}
Math_Vec3f_Copy(&this->actor.focus.pos, &this->limbPos[4]);
Math_Vec3f_Copy(&this->actor.focus.pos, &this->bodyPartsPos[DINOFOS_BODYPART_UPPER_BODY]);
this->actor.focus.rot.y = this->actor.shape.rot.y + this->unk_28E;
if (this->colliderJntSph.base.acFlags & AC_ON) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base);
@@ -1413,13 +1417,35 @@ s32 func_8089DC4C(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return 0;
}
static Vec3f D_8089E38C = { 400.0f, -3600.0f, 0.0f };
static Vec3f D_8089E398 = { 300.0f, 500.0f, 0.0f };
static Vec3f D_8089E3A4 = { 700.0f, 400.0f, 0.0f };
static s8 sLimbToBodyParts[DINOLFOS_LIMB_MAX] = {
BODYPART_NONE, // DINOLFOS_LIMB_NONE
BODYPART_NONE, // DINOLFOS_LIMB_LOWER_BODY
DINOFOS_BODYPART_LEFT_UPPER_LEG, // DINOLFOS_LIMB_LEFT_UPPER_LEG
BODYPART_NONE, // DINOLFOS_LIMB_LEFT_LOWER_LEG
DINOFOS_BODYPART_LEFT_CLAWS, // DINOLFOS_LIMB_LEFT_CLAWS
DINOFOS_BODYPART_RIGHT_UPPER_LEG, // DINOLFOS_LIMB_RIGHT_UPPER_LEG
BODYPART_NONE, // DINOLFOS_LIMB_RIGHT_LOWER_LEG
DINOFOS_BODYPART_RIGHT_CLAWS, // DINOLFOS_LIMB_RIGHT_CLAWS
DINOFOS_BODYPART_UPPER_BODY, // DINOLFOS_LIMB_UPPER_BODY
BODYPART_NONE, // DINOLFOS_LIMB_LEFT_UPPER_ARM
DINOFOS_BODYPART_LEFT_FOREARM, // DINOLFOS_LIMB_LEFT_FOREARM
DINOFOS_BODYPART_LEFT_HAND, // DINOLFOS_LIMB_LEFT_HAND
BODYPART_NONE, // DINOLFOS_LIMB_RIGHT_UPPER_ARM
DINOFOS_BODYPART_RIGHT_FOREARM, // DINOLFOS_LIMB_RIGHT_FOREARM
DINOFOS_BODYPART_RIGHT_HAND, // DINOLFOS_LIMB_RIGHT_HAND
BODYPART_NONE, // DINOLFOS_LIMB_NECK
DINOFOS_BODYPART_HEAD, // DINOLFOS_LIMB_HEAD
DINOFOS_BODYPART_JAW, // DINOLFOS_LIMB_JAW
BODYPART_NONE, // DINOLFOS_LIMB_UPPER_TAIL
DINOFOS_BODYPART_LOWER_TAIL, // DINOLFOS_LIMB_LOWER_TAIL
BODYPART_NONE, // DINOLFOS_LIMB_KNIFE
};
void func_8089DC84(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static Vec3f D_8089E38C = { 400.0f, -3600.0f, 0.0f };
static Vec3f D_8089E398 = { 300.0f, 500.0f, 0.0f };
static Vec3f D_8089E3A4 = { 700.0f, 400.0f, 0.0f };
static s8 D_8089E3B0[] = {
-1, -1, 0, -1, 1, 2, -1, 3, 4, -1, 5, 6, -1, 7, 8, -1, 9, 10, -1, 11, -1,
};
EnDinofos* this = THIS;
Vec3f sp80;
Vec3f sp74;
@@ -1430,8 +1456,8 @@ void func_8089DC84(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
MtxF* sp48;
Collider_UpdateSpheres(limbIndex, &this->colliderJntSph);
if (D_8089E3B0[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[D_8089E3B0[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if ((limbIndex == DINOLFOS_LIMB_RIGHT_HAND) && (this->unk_292 != this->unk_290) &&
@@ -1463,7 +1489,8 @@ void func_8089DC84(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
sp4C.x -= sp48->mf[3][0];
sp4C.y -= sp48->mf[3][1];
sp4C.z -= sp48->mf[3][2];
EffectSsDFire_Spawn(play, &this->limbPos[10], &sp4C, &gZeroVec3f, 30, 22, 255 - (sp58 * 20), 20, 3, 8);
EffectSsDFire_Spawn(play, &this->bodyPartsPos[DINOFOS_BODYPART_JAW], &sp4C, &gZeroVec3f, 30, 22,
255 - (sp58 * 20), 20, 3, 8);
this->unk_292 = this->unk_290;
}
}
@@ -1498,7 +1525,7 @@ void EnDinofos_Draw(Actor* thisx, PlayState* play) {
func_8089DC4C, func_8089DC84, &this->actor, POLY_XLU_DISP);
}
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, DINOFOS_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);
@@ -8,6 +8,22 @@ struct EnDinofos;
typedef void (*EnDinofosActionFunc)(struct EnDinofos*, PlayState*);
typedef enum EnDinofosBodyPart {
/* 0 */ DINOFOS_BODYPART_LEFT_UPPER_LEG,
/* 1 */ DINOFOS_BODYPART_LEFT_CLAWS,
/* 2 */ DINOFOS_BODYPART_RIGHT_UPPER_LEG,
/* 3 */ DINOFOS_BODYPART_RIGHT_CLAWS,
/* 4 */ DINOFOS_BODYPART_UPPER_BODY,
/* 5 */ DINOFOS_BODYPART_LEFT_FOREARM,
/* 6 */ DINOFOS_BODYPART_LEFT_HAND,
/* 7 */ DINOFOS_BODYPART_RIGHT_FOREARM,
/* 8 */ DINOFOS_BODYPART_RIGHT_HAND,
/* 9 */ DINOFOS_BODYPART_HEAD,
/* 10 */ DINOFOS_BODYPART_JAW,
/* 11 */ DINOFOS_BODYPART_LOWER_TAIL,
/* 12 */ DINOFOS_BODYPART_MAX
} EnDinofosBodyPart;
typedef struct EnDinofos {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -34,7 +50,7 @@ typedef struct EnDinofos {
/* 0x2B8 */ f32 drawDmgEffFrozenSteamScale;
/* 0x2BC */ Vec3f unk_2BC;
/* 0x2C8 */ Vec3f unk_2C8;
/* 0x2D4 */ Vec3f limbPos[12];
/* 0x2D4 */ Vec3f bodyPartsPos[DINOFOS_BODYPART_MAX];
/* 0x364 */ ColliderJntSph colliderJntSph;
/* 0x384 */ ColliderJntSphElement colliderJntSphElement[9];
/* 0x5C4 */ ColliderQuad colliderQuad;
@@ -432,7 +432,8 @@ void func_80876D28(EnDodongo* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->collider1.base.colType = COLTYPE_HIT0;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, &this->limbPos[0], 9, 2, this->unk_334 * 0.3f, this->unk_334 * 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DODONGO_BODYPART_MAX, 2, this->unk_334 * 0.3f,
this->unk_334 * 0.2f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -448,7 +449,7 @@ void func_80876DC4(EnDodongo* this, PlayState* play) {
f32 temp_f22;
f32 temp_f20;
Math_Vec3f_Copy(&sp68, &this->limbPos[0]);
Math_Vec3f_Copy(&sp68, &this->bodyPartsPos[DODONGO_BODYPART_0]);
sp66 = ((s32)Rand_Next() >> 0x12) + this->actor.shape.rot.y;
temp_f20 = Math_CosS(sp66);
temp_f22 = Math_SinS(sp66);
@@ -496,8 +497,8 @@ void func_80876DC4(EnDodongo* this, PlayState* play) {
sp74.z = (Rand_ZeroFloat(0.1f) + 0.15f) * -temp_f22 * this->unk_334;
func_800B0EB0(play, &sp68, &sp80, &sp74, &this->unk_32C, &this->unk_330, sp64, sp62, 0x14);
sp68.x = this->limbPos[0].x + (temp_f20 * 6.0f * this->unk_334);
sp68.z = this->limbPos[0].z - (temp_f22 * 6.0f * this->unk_334);
sp68.x = this->bodyPartsPos[DODONGO_BODYPART_0].x + (temp_f20 * 6.0f * this->unk_334);
sp68.z = this->bodyPartsPos[DODONGO_BODYPART_0].z - (temp_f22 * 6.0f * this->unk_334);
sp80.x *= -1.0f;
sp80.z = sp80.z * -1.0f;
sp74.x = (Rand_ZeroFloat(0.1f) + 0.15f) * -temp_f20 * this->unk_334;
@@ -623,9 +624,9 @@ void func_808777A8(EnDodongo* this) {
for (i = 0; i < ARRAY_COUNT(this->collider3Elements); i++) {
sph = &this->collider3.elements[i].dim.worldSphere;
sph->center.x = this->limbPos[0].x;
sph->center.y = this->limbPos[0].y;
sph->center.z = this->limbPos[0].z;
sph->center.x = this->bodyPartsPos[DODONGO_BODYPART_0].x;
sph->center.y = this->bodyPartsPos[DODONGO_BODYPART_0].y;
sph->center.z = this->bodyPartsPos[DODONGO_BODYPART_0].z;
sph->radius = 0;
}
@@ -659,10 +660,12 @@ void func_8087784C(EnDodongo* this, PlayState* play) {
temp_f12 = Math_CosS(this->actor.shape.rot.y) * this->unk_334;
for (i = 0; i < end; i++, element++) {
element->dim.worldSphere.center.x = this->limbPos[0].x + (element->dim.modelSphere.center.z * temp_f2);
element->dim.worldSphere.center.x =
this->bodyPartsPos[DODONGO_BODYPART_0].x + (element->dim.modelSphere.center.z * temp_f2);
element->dim.worldSphere.center.y =
this->limbPos[0].y + (element->dim.modelSphere.center.y * this->unk_334);
element->dim.worldSphere.center.z = this->limbPos[0].z + (element->dim.modelSphere.center.z * temp_f12);
this->bodyPartsPos[DODONGO_BODYPART_0].y + (element->dim.modelSphere.center.y * this->unk_334);
element->dim.worldSphere.center.z =
this->bodyPartsPos[DODONGO_BODYPART_0].z + (element->dim.modelSphere.center.z * temp_f12);
element->dim.worldSphere.radius = element->dim.modelSphere.radius;
}
@@ -670,8 +673,8 @@ void func_8087784C(EnDodongo* this, PlayState* play) {
D_80879348.x = 2.5f * temp_f2;
D_80879348.y = this->unk_334 * 1.4f;
D_80879348.z = 2.5f * temp_f12;
EffectSsDFire_Spawn(play, &this->limbPos[0], &D_80879354, &D_80879348, this->unk_334 * 100.0f,
this->unk_334 * 35.0f, 0xFF - (frame * 10), 5, 0, 8);
EffectSsDFire_Spawn(play, &this->bodyPartsPos[DODONGO_BODYPART_0], &D_80879354, &D_80879348,
this->unk_334 * 100.0f, this->unk_334 * 35.0f, 0xFF - (frame * 10), 5, 0, 8);
} else if ((this->skelAnime.curFrame >= 2.0f) && (this->skelAnime.curFrame <= 20.0f)) {
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EN_DODO_J_BREATH - SFX_FLAG);
}
@@ -773,13 +776,13 @@ void func_80877E60(EnDodongo* this, PlayState* play) {
} else {
sp5E = this->unk_334 * 50.0f;
sp5C = this->unk_334 * 5.0f;
Math_Vec3f_Copy(&sp64, &this->limbPos[0]);
Math_Vec3f_Copy(&sp64, &this->bodyPartsPos[DODONGO_BODYPART_0]);
func_800B0DE0(play, &sp64, &gZeroVec3f, &D_80879360, &D_8087936C, &D_8087936C, sp5E, sp5C);
sp64.x -= Math_CosS(this->actor.shape.rot.y) * 6.0f * this->unk_334;
sp64.z += Math_SinS(this->actor.shape.rot.y) * 6.0f * this->unk_334;
func_800B0DE0(play, &sp64, &gZeroVec3f, &D_80879360, &D_8087936C, &D_8087936C, sp5E, sp5C);
sp64.x = (2.0f * this->limbPos[0].x) - sp64.x;
sp64.z = (2.0f * this->limbPos[0].z) - sp64.z;
sp64.x = (2.0f * this->bodyPartsPos[DODONGO_BODYPART_0].x) - sp64.x;
sp64.z = (2.0f * this->bodyPartsPos[DODONGO_BODYPART_0].z) - sp64.z;
func_800B0DE0(play, &sp64, &gZeroVec3f, &D_80879360, &D_8087936C, &D_8087936C, sp5E, sp5C);
}
}
@@ -1072,32 +1075,64 @@ s32 EnDodongo_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3
return false;
}
static Vec3f D_80879370 = { 1800.0f, 1200.0f, 0.0f };
static Vec3f D_8087937C = { 1500.0f, 300.0f, 0.0f };
static s8 sLimbToBodyParts[OBJECT_DODONGO_LIMB_MAX] = {
BODYPART_NONE, // OBJECT_DODONGO_LIMB_NONE
BODYPART_NONE, // OBJECT_DODONGO_LIMB_01
BODYPART_NONE, // OBJECT_DODONGO_LIMB_02
BODYPART_NONE, // OBJECT_DODONGO_LIMB_03
BODYPART_NONE, // OBJECT_DODONGO_LIMB_04
BODYPART_NONE, // OBJECT_DODONGO_LIMB_05
BODYPART_NONE, // OBJECT_DODONGO_LIMB_06
BODYPART_NONE, // OBJECT_DODONGO_LIMB_07
BODYPART_NONE, // OBJECT_DODONGO_LIMB_08
BODYPART_NONE, // OBJECT_DODONGO_LIMB_09
BODYPART_NONE, // OBJECT_DODONGO_LIMB_0A
BODYPART_NONE, // OBJECT_DODONGO_LIMB_0B
BODYPART_NONE, // OBJECT_DODONGO_LIMB_0C
DODONGO_BODYPART_2, // OBJECT_DODONGO_LIMB_0D
DODONGO_BODYPART_3, // OBJECT_DODONGO_LIMB_0E
DODONGO_BODYPART_4, // OBJECT_DODONGO_LIMB_0F
BODYPART_NONE, // OBJECT_DODONGO_LIMB_10
BODYPART_NONE, // OBJECT_DODONGO_LIMB_11
BODYPART_NONE, // OBJECT_DODONGO_LIMB_12
BODYPART_NONE, // OBJECT_DODONGO_LIMB_13
BODYPART_NONE, // OBJECT_DODONGO_LIMB_14
DODONGO_BODYPART_5, // OBJECT_DODONGO_LIMB_15
DODONGO_BODYPART_6, // OBJECT_DODONGO_LIMB_16
BODYPART_NONE, // OBJECT_DODONGO_LIMB_17
BODYPART_NONE, // OBJECT_DODONGO_LIMB_18
BODYPART_NONE, // OBJECT_DODONGO_LIMB_19
BODYPART_NONE, // OBJECT_DODONGO_LIMB_1A
BODYPART_NONE, // OBJECT_DODONGO_LIMB_1B
DODONGO_BODYPART_7, // OBJECT_DODONGO_LIMB_1C
DODONGO_BODYPART_8, // OBJECT_DODONGO_LIMB_1D
BODYPART_NONE, // OBJECT_DODONGO_LIMB_1E
};
void EnDodongo_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80879370 = { 1800.0f, 1200.0f, 0.0f };
static Vec3f D_8087937C = { 1500.0f, 300.0f, 0.0f };
static s8 D_80879388[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 3, 4,
-1, -1, -1, -1, -1, 5, 6, -1, -1, -1, -1, -1, 7, 8, -1, 0,
};
EnDodongo* this = THIS;
Collider_UpdateSpheres(limbIndex, &this->collider1);
Collider_UpdateSpheres(limbIndex, &this->collider2);
if (D_80879388[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[D_80879388[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == 7) {
Matrix_MultVec3f(&D_80879370, &this->unk_308);
Matrix_MultVec3f(&D_8087937C, &this->limbPos[0]);
Matrix_MultVec3f(&D_8087937C, &this->bodyPartsPos[DODONGO_BODYPART_0]);
Matrix_MultZero(&this->actor.focus.pos);
Matrix_MultVecY(-200.0f, &this->limbPos[1]);
Matrix_MultVecY(-200.0f, &this->bodyPartsPos[DODONGO_BODYPART_1]);
} else if (limbIndex == 13) {
Matrix_MultVecX(1600.0f, &this->unk_320);
}
if ((limbIndex == 30) && (this->actionFunc == func_80878424) && (this->timer != this->unk_304)) {
EffectBlure_AddVertex(Effect_GetByIndex(this->unk_338), &this->unk_320, &this->limbPos[4]);
EffectBlure_AddVertex(Effect_GetByIndex(this->unk_338), &this->unk_320,
&this->bodyPartsPos[DODONGO_BODYPART_4]);
this->unk_304 = this->timer;
}
}
@@ -1108,7 +1143,7 @@ void EnDodongo_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDodongo_OverrideLimbDraw,
EnDodongo_PostLimbDraw, &this->actor);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, DODONGO_BODYPART_MAX,
this->drawDmgEffScale * this->unk_334, this->drawDmgEffFrozenSteamScale * this->unk_334,
this->drawDmgEffAlpha, this->drawDmgEffType);
}
@@ -7,6 +7,19 @@ struct EnDodongo;
typedef void (*EnDodongoActionFunc)(struct EnDodongo*, PlayState*);
typedef enum DodongoBodyPart {
/* 0 */ DODONGO_BODYPART_0,
/* 1 */ DODONGO_BODYPART_1,
/* 2 */ DODONGO_BODYPART_2,
/* 3 */ DODONGO_BODYPART_3,
/* 4 */ DODONGO_BODYPART_4,
/* 5 */ DODONGO_BODYPART_5,
/* 6 */ DODONGO_BODYPART_6,
/* 7 */ DODONGO_BODYPART_7,
/* 8 */ DODONGO_BODYPART_8,
/* 9 */ DODONGO_BODYPART_MAX
} DodongoBodyPart;
typedef struct EnDodongo {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -27,7 +40,7 @@ typedef struct EnDodongo {
/* 0x33C */ f32 drawDmgEffAlpha;
/* 0x340 */ f32 drawDmgEffScale;
/* 0x344 */ f32 drawDmgEffFrozenSteamScale;
/* 0x348 */ Vec3f limbPos[9];
/* 0x348 */ Vec3f bodyPartsPos[DODONGO_BODYPART_MAX];
/* 0x3B4 */ ColliderJntSph collider1;
/* 0x3D4 */ ColliderJntSphElement collider1Elements[10];
/* 0x654 */ ColliderJntSph collider2;
+5 -5
View File
@@ -1460,10 +1460,10 @@ void EnEgol_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot
(limbIndex == EYEGORE_LIMB_RIGHT_HAND) || (limbIndex == EYEGORE_LIMB_UPPER_EYELID) ||
(limbIndex == EYEGORE_LIMB_LOWER_EYELID) || (limbIndex == EYEGORE_LIMB_HIPS) ||
(limbIndex == EYEGORE_LIMB_LEFT_SHIN) || (limbIndex == EYEGORE_LIMB_RIGHT_SHIN)) {
Matrix_MultZero(&this->limbPos[this->limbPosIndex]);
this->limbPosIndex++;
if (this->limbPosIndex >= ARRAY_COUNT(this->limbPos)) {
this->limbPosIndex = 0;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartIndex++;
if (this->bodyPartIndex >= EYEGORE_BODYPART_MAX) {
this->bodyPartIndex = 0;
}
}
Collider_UpdateSpheres(limbIndex, &this->bodyCollider);
@@ -1486,7 +1486,7 @@ void EnEgol_Draw(Actor* thisx, PlayState* play2) {
if (this->dmgEffectTimer != 0) {
f32 drawDmgEffAlpha = 0.05f * this->dmgEffectTimer;
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 0.8f, 0.8f,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, EYEGORE_BODYPART_MAX, 0.8f, 0.8f,
drawDmgEffAlpha, ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
}
if (this->laserState >= EYEGORE_LASER_FIRE) {
+18 -2
View File
@@ -29,6 +29,22 @@ typedef struct {
/* 0x38 */ f32 scale;
} EnEgolEffect; // size = 0x3C
typedef enum EyegoreBodyPart {
/* 0 */ EYEGORE_BODYPART_0,
/* 1 */ EYEGORE_BODYPART_1,
/* 2 */ EYEGORE_BODYPART_2,
/* 3 */ EYEGORE_BODYPART_3,
/* 4 */ EYEGORE_BODYPART_4,
/* 5 */ EYEGORE_BODYPART_5,
/* 6 */ EYEGORE_BODYPART_6,
/* 7 */ EYEGORE_BODYPART_7,
/* 8 */ EYEGORE_BODYPART_8,
/* 9 */ EYEGORE_BODYPART_9,
/* 10 */ EYEGORE_BODYPART_10,
/* 11 */ EYEGORE_BODYPART_11,
/* 12 */ EYEGORE_BODYPART_MAX
} EyegoreBodyPart;
typedef struct EnEgol {
/* 0x0000 */ Actor actor;
/* 0x0144 */ SkelAnime skelAnime;
@@ -43,8 +59,8 @@ typedef struct EnEgol {
/* 0x02B4 */ s16 headRot;
/* 0x02BA */ s16 switchFlag;
/* 0x02BC */ s16 dmgEffectTimer;
/* 0x02C0 */ Vec3f limbPos[12];
/* 0x0350 */ s16 limbPosIndex;
/* 0x02C0 */ Vec3f bodyPartsPos[EYEGORE_BODYPART_MAX];
/* 0x0350 */ s16 bodyPartIndex;
/* 0x0352 */ s16 pathIndex;
/* 0x0354 */ s32 animIndex;
/* 0x0358 */ u8 isRetreating;
+1 -1
View File
@@ -654,7 +654,7 @@ void func_8088DD34(EnElf* this, PlayState* play) {
func_8088CBAC(this, play);
if (this->fairyFlags & 0x800) {
this->unk_224.y = player->bodyPartsPos[0].y;
this->unk_224.y = player->bodyPartsPos[PLAYER_BODYPART_WAIST].y;
}
func_8088D8D0(this, &this->unk_224);
@@ -38,10 +38,10 @@ static s16 sActorIds[] = {
};
static s16 sActorParams[] = {
EN_GRASSHOPPER_PARAMS(EN_GRASSHOPPER_TYPE_GROWS_WHEN_SPAWNED), // EN_ENCOUNT1_GRASSHOPPER
WALLMASTER_PARAMS(WALLMASTER_TYPE_TIMER_ONLY, 0, false), // EN_ENCOUNT1_WALLMASTER
ENPR2_PARAMS(1, 0), // EN_ENCOUNT1_SKULLFISH
ENPR2_PARAMS(3, 0) // EN_ENCOUNT1_SKULLFISH_2
DRAGONFLY_PARAMS(DRAGONFLY_TYPE_GROWS_WHEN_SPAWNED), // EN_ENCOUNT1_GRASSHOPPER
WALLMASTER_PARAMS(WALLMASTER_TYPE_TIMER_ONLY, 0, false), // EN_ENCOUNT1_WALLMASTER
ENPR2_PARAMS(1, 0), // EN_ENCOUNT1_SKULLFISH
ENPR2_PARAMS(3, 0) // EN_ENCOUNT1_SKULLFISH_2
};
void EnEncount1_Init(Actor* thisx, PlayState* play) {
@@ -180,7 +180,7 @@ void EnFirefly_SpawnIceEffects(EnFirefly* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, &this->limbPos[0], 3, 2, 0.2f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, KEESE_BODYPART_MAX, 2, 0.2f, 0.2f);
}
}
@@ -807,11 +807,11 @@ void EnFirefly_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
}
if (limbIndex == FIRE_KEESE_LIMB_LEFT_WING_END) {
Matrix_MultZero(&this->limbPos[0]);
Matrix_MultZero(&this->bodyPartsPos[KEESE_BODYPART_LEFT_WING_END]);
} else if (limbIndex == FIRE_KEESE_LIMB_RIGHT_WING_END_ROOT) {
Matrix_MultZero(&this->limbPos[1]);
Matrix_MultZero(&this->bodyPartsPos[KEESE_BODYPART_RIGHT_WING_END_ROOT]);
} else if (limbIndex == FIRE_KEESE_LIMB_BODY) {
Matrix_MultZero(&this->limbPos[2]);
Matrix_MultZero(&this->bodyPartsPos[KEESE_BODYPART_BODY]);
}
}
@@ -844,7 +844,7 @@ void EnFirefly_Draw(Actor* thisx, PlayState* play) {
POLY_OPA_DISP = gfx;
}
Actor_DrawDamageEffects(play, NULL, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, NULL, this->bodyPartsPos, KEESE_BODYPART_MAX,
this->drawDmgEffScale * this->actor.scale.y * 200.0f, this->drawDmgEffFrozenSteamScale,
this->drawDmgEffAlpha, this->drawDmgEffType);
this->lastDrawnFrame = play->gameplayFrames;
@@ -18,6 +18,13 @@ typedef enum {
#define KEESE_INVISIBLE (1 << 0xF)
#define KEESE_GET_MAIN_TYPE(thisx) ((thisx)->params & 0x7FFF)
typedef enum KeeseBodyPart {
/* 0 */ KEESE_BODYPART_LEFT_WING_END,
/* 1 */ KEESE_BODYPART_RIGHT_WING_END_ROOT,
/* 2 */ KEESE_BODYPART_BODY,
/* 3 */ KEESE_BODYPART_MAX
} KeeseBodyPart;
typedef struct EnFirefly {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -35,7 +42,7 @@ typedef struct EnFirefly {
/* 0x2E8 */ f32 drawDmgEffScale;
/* 0x2E8 */ f32 drawDmgEffFrozenSteamScale;
/* 0x2F4 */ u32 lastDrawnFrame;
/* 0x2F8 */ Vec3f limbPos[3];
/* 0x2F8 */ Vec3f bodyPartsPos[KEESE_BODYPART_MAX];
/* 0x31C */ ColliderSphere collider;
} EnFirefly; // size = 0x374
@@ -237,7 +237,7 @@ void func_808D0A48(EnFloormas* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->collider.base.colType = COLTYPE_HIT0;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2,
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ENFLOORMAS_BODYPART_MAX, 2,
this->actor.scale.x * 30.000002f, this->actor.scale.x * 20.0f);
if (this->actor.scale.x > 0.009f) {
this->actor.flags |= ACTOR_FLAG_400;
@@ -1157,44 +1157,44 @@ s32 EnFloormas_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
return false;
}
static s8 D_808D393C[WALLMASTER_LIMB_MAX] = {
-1, // WALLMASTER_LIMB_NONE
-1, // WALLMASTER_LIMB_ROOT
-1, // WALLMASTER_LIMB_HAND
-1, // WALLMASTER_LIMB_INDEX_FINGER_ROOT
0, // WALLMASTER_LIMB_INDEX_FINGER_PROXIMAL
-1, // WALLMASTER_LIMB_INDEX_FINGER_DISTAL_ROOT
-1, // WALLMASTER_LIMB_INDEX_FINGER_MIDDLE
1, // WALLMASTER_LIMB_INDEX_FINGER_DISTAL
-1, // WALLMASTER_LIMB_RING_FINGER_ROOT
2, // WALLMASTER_LIMB_RING_FINGER_PROXIMAL
-1, // WALLMASTER_LIMB_RING_FINGER_DISTAL_ROOT
-1, // WALLMASTER_LIMB_RING_FINGER_MIDDLE
3, // WALLMASTER_LIMB_RING_FINGER_DISTAL
-1, // WALLMASTER_LIMB_MIDDLE_FINGER_ROOT
4, // WALLMASTER_LIMB_MIDDLE_FINGER_PROXIMAL
-1, // WALLMASTER_LIMB_MIDDLE_FINGER_DISTAL_ROOT
-1, // WALLMASTER_LIMB_MIDDLE_FINGER_MIDDLE
5, // WALLMASTER_LIMB_MIDDLE_FINGER_DISTAL
-1, // WALLMASTER_LIMB_WRIST_ROOT
-1, // WALLMASTER_LIMB_WRIST
-1, // WALLMASTER_LIMB_THUMB_ROOT
6, // WALLMASTER_LIMB_THUMB_PROXIMAL
7, // WALLMASTER_LIMB_THUMB_DISTAL_ROOT
-1, // WALLMASTER_LIMB_THUMB_MIDDLE
8, // WALLMASTER_LIMB_THUMB_DISTAL
static s8 sLimbToBodyParts[WALLMASTER_LIMB_MAX] = {
BODYPART_NONE, // WALLMASTER_LIMB_NONE
BODYPART_NONE, // WALLMASTER_LIMB_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_HAND
BODYPART_NONE, // WALLMASTER_LIMB_INDEX_FINGER_ROOT
ENFLOORMAS_BODYPART_0, // WALLMASTER_LIMB_INDEX_FINGER_PROXIMAL
BODYPART_NONE, // WALLMASTER_LIMB_INDEX_FINGER_DISTAL_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_INDEX_FINGER_MIDDLE
ENFLOORMAS_BODYPART_1, // WALLMASTER_LIMB_INDEX_FINGER_DISTAL
BODYPART_NONE, // WALLMASTER_LIMB_RING_FINGER_ROOT
ENFLOORMAS_BODYPART_2, // WALLMASTER_LIMB_RING_FINGER_PROXIMAL
BODYPART_NONE, // WALLMASTER_LIMB_RING_FINGER_DISTAL_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_RING_FINGER_MIDDLE
ENFLOORMAS_BODYPART_3, // WALLMASTER_LIMB_RING_FINGER_DISTAL
BODYPART_NONE, // WALLMASTER_LIMB_MIDDLE_FINGER_ROOT
ENFLOORMAS_BODYPART_4, // WALLMASTER_LIMB_MIDDLE_FINGER_PROXIMAL
BODYPART_NONE, // WALLMASTER_LIMB_MIDDLE_FINGER_DISTAL_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_MIDDLE_FINGER_MIDDLE
ENFLOORMAS_BODYPART_5, // WALLMASTER_LIMB_MIDDLE_FINGER_DISTAL
BODYPART_NONE, // WALLMASTER_LIMB_WRIST_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_WRIST
BODYPART_NONE, // WALLMASTER_LIMB_THUMB_ROOT
ENFLOORMAS_BODYPART_6, // WALLMASTER_LIMB_THUMB_PROXIMAL
ENFLOORMAS_BODYPART_7, // WALLMASTER_LIMB_THUMB_DISTAL_ROOT
BODYPART_NONE, // WALLMASTER_LIMB_THUMB_MIDDLE
ENFLOORMAS_BODYPART_8, // WALLMASTER_LIMB_THUMB_DISTAL
};
void EnFloormas_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
EnFloormas* this = THIS;
if (D_808D393C[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[D_808D393C[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == WALLMASTER_LIMB_WRIST) {
Matrix_MultVecX(1000.0f, &this->limbPos[9]);
Matrix_MultVecX(-1000.0f, &this->limbPos[10]);
Matrix_MultVecX(1000.0f, &this->bodyPartsPos[ENFLOORMAS_BODYPART_9]);
Matrix_MultVecX(-1000.0f, &this->bodyPartsPos[ENFLOORMAS_BODYPART_10]);
} else if (limbIndex == WALLMASTER_LIMB_HAND) {
Matrix_Push();
Matrix_Translate(1600.0f, -700.0f, -1700.0f, MTXMODE_APPLY);
@@ -1230,7 +1230,7 @@ void EnFloormas_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENFLOORMAS_BODYPART_MAX,
100.0f * (this->drawDmgEffScale * this->actor.scale.x),
100.0f * (this->drawDmgEffFrozenSteamScale * this->actor.scale.x), this->drawDmgEffAlpha,
this->drawDmgEffType);
@@ -1255,7 +1255,7 @@ void func_808D3754(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENFLOORMAS_BODYPART_MAX,
this->drawDmgEffScale * this->actor.scale.x * 100.0f,
this->drawDmgEffFrozenSteamScale * this->actor.scale.x * 100.0f, this->drawDmgEffAlpha,
this->drawDmgEffType);
@@ -18,6 +18,21 @@ typedef enum {
/* 0x40 */ ENFLOORMAS_GET_7FFF_40 = 0x40
} EnFloormasParam;
typedef enum EnFloormasBodyPart {
/* 0 */ ENFLOORMAS_BODYPART_0,
/* 1 */ ENFLOORMAS_BODYPART_1,
/* 2 */ ENFLOORMAS_BODYPART_2,
/* 3 */ ENFLOORMAS_BODYPART_3,
/* 4 */ ENFLOORMAS_BODYPART_4,
/* 5 */ ENFLOORMAS_BODYPART_5,
/* 6 */ ENFLOORMAS_BODYPART_6,
/* 7 */ ENFLOORMAS_BODYPART_7,
/* 8 */ ENFLOORMAS_BODYPART_8,
/* 9 */ ENFLOORMAS_BODYPART_9,
/* 10 */ ENFLOORMAS_BODYPART_10,
/* 11 */ ENFLOORMAS_BODYPART_MAX
} EnFloormasBodyPart;
typedef struct EnFloormas {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -32,7 +47,7 @@ typedef struct EnFloormas {
/* 0x2C4 */ f32 drawDmgEffAlpha;
/* 0x2C8 */ f32 drawDmgEffScale;
/* 0x2CC */ f32 drawDmgEffFrozenSteamScale;
/* 0x2D0 */ Vec3f limbPos[11];
/* 0x2D0 */ Vec3f bodyPartsPos[ENFLOORMAS_BODYPART_MAX];
/* 0x354 */ ColliderCylinder collider;
} EnFloormas; // size = 0x3A0
+6 -6
View File
@@ -863,14 +863,14 @@ void EnFz_Draw(Actor* thisx, PlayState* play) {
if (this->drawDmgEffTimer > 0) {
s32 pad2[6];
Vec3f limbPos[2];
Vec3f bodyPartsPos[2];
s32 pad3;
limbPos[0] = this->actor.world.pos;
limbPos[1] = this->actor.world.pos;
limbPos[0].y += 20.0f;
limbPos[1].y += 40.0f;
Actor_DrawDamageEffects(play, NULL, limbPos, ARRAY_COUNT(limbPos), this->drawDmgEffScale * 4.0f, 0.5f,
bodyPartsPos[0] = this->actor.world.pos;
bodyPartsPos[1] = this->actor.world.pos;
bodyPartsPos[0].y += 20.0f;
bodyPartsPos[1].y += 40.0f;
Actor_DrawDamageEffects(play, NULL, bodyPartsPos, ARRAY_COUNT(bodyPartsPos), this->drawDmgEffScale * 4.0f, 0.5f,
this->drawDmgEffAlpha, ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
}
+2 -1
View File
@@ -185,7 +185,8 @@ s32 EnGe2_LookForPlayer(PlayState* play, Actor* actor, Vec3f* pos, s16 yaw, s16
return false;
}
if (BgCheck_AnyLineTest1(&play->colCtx, pos, &player->bodyPartsPos[7], &posResult, &outPoly, false)) {
if (BgCheck_AnyLineTest1(&play->colCtx, pos, &player->bodyPartsPos[PLAYER_BODYPART_HEAD], &posResult, &outPoly,
false)) {
return false;
} else {
return true;
+1 -1
View File
@@ -821,7 +821,7 @@ void func_8094F0E0(EnGm* this) {
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
if (this->unk_268->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_268)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_268)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_268->focus.pos);
}
+1 -1
View File
@@ -1174,7 +1174,7 @@ s32 EnGo_UpdateRotationToTarget(EnGo* this, PlayState* play) {
Math_Vec3f_Copy(&thisPos, &this->actor.focus.pos);
if (this->attentionTarget->id == ACTOR_PLAYER) {
targetPos.y = ((Player*)this->attentionTarget)->bodyPartsPos[7].y + 3.0f;
targetPos.y = ((Player*)this->attentionTarget)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&targetPos, &this->attentionTarget->focus.pos);
}
@@ -43,99 +43,170 @@ void EnGrasshopper_UpdateEffects(EnGrasshopper* this, PlayState* play);
void EnGrasshopper_DrawEffects(EnGrasshopper* this, PlayState* play);
typedef enum {
/* 0 */ EN_GRASSHOPPER_ACTION_FLY,
/* 1 */ EN_GRASSHOPPER_ACTION_ROAM_IN_CIRCLES,
/* 2 */ EN_GRASSHOPPER_ACTION_BANK,
/* 3 */ EN_GRASSHOPPER_ACTION_BOUNCED,
/* 4 */ EN_GRASSHOPPER_ACTION_DECIDE_ACTION,
/* 5 */ EN_GRASSHOPPER_ACTION_APPROACH_PLAYER,
/* 6 */ EN_GRASSHOPPER_ACTION_ATTACK,
/* 7 */ EN_GRASSHOPPER_ACTION_WAIT_AFTER_ATTACK,
/* 8 */ EN_GRASSHOPPER_ACTION_DAMAGED,
/* 9 */ EN_GRASSHOPPER_ACTION_DEAD,
/* 10 */ EN_GRASSHOPPER_ACTION_FALL
/* 0 */ DRAGONFLY_ACTION_FLY,
/* 1 */ DRAGONFLY_ACTION_ROAM_IN_CIRCLES,
/* 2 */ DRAGONFLY_ACTION_BANK,
/* 3 */ DRAGONFLY_ACTION_BOUNCED,
/* 4 */ DRAGONFLY_ACTION_DECIDE_ACTION,
/* 5 */ DRAGONFLY_ACTION_APPROACH_PLAYER,
/* 6 */ DRAGONFLY_ACTION_ATTACK,
/* 7 */ DRAGONFLY_ACTION_WAIT_AFTER_ATTACK,
/* 8 */ DRAGONFLY_ACTION_DAMAGED,
/* 9 */ DRAGONFLY_ACTION_DEAD,
/* 10 */ DRAGONFLY_ACTION_FALL
} EnGrasshopperAction;
typedef enum {
/* 0 */ EN_GRASSHOPPER_DECISION_ATTACK,
/* 1 */ EN_GRASSHOPPER_DECISION_FLY,
/* 2 */ EN_GRASSHOPPER_DECISION_ROAM_IN_CIRCLES // Never used in the final game
/* 0 */ DRAGONFLY_DECISION_ATTACK,
/* 1 */ DRAGONFLY_DECISION_FLY,
/* 2 */ DRAGONFLY_DECISION_ROAM_IN_CIRCLES // Never used in the final game
} EnGrasshopperNextAction;
typedef enum {
/* 0 */ EN_GRASSHOPPER_BANK_STATE_BANKING,
/* 1 */ EN_GRASSHOPPER_BANK_STATE_DONE
/* 0 */ DRAGONFLY_BANK_STATE_BANKING,
/* 1 */ DRAGONFLY_BANK_STATE_DONE
} EnGrasshopperBankState;
typedef enum {
/* 0 */ EN_GRASSHOPPER_ANIM_RAISE_TAIL,
/* 1 */ EN_GRASSHOPPER_ANIM_LOWER_TAIL,
/* 2 */ EN_GRASSHOPPER_ANIM_FLY,
/* 3 */ EN_GRASSHOPPER_ANIM_ATTACK,
/* 4 */ EN_GRASSHOPPER_ANIM_HOVER,
/* 5 */ EN_GRASSHOPPER_ANIM_DAMAGE,
/* 6 */ EN_GRASSHOPPER_ANIM_DEAD,
/* 7 */ EN_GRASSHOPPER_ANIM_FALL
/* 0 */ DRAGONFLY_ANIM_RAISE_TAIL,
/* 1 */ DRAGONFLY_ANIM_LOWER_TAIL,
/* 2 */ DRAGONFLY_ANIM_FLY,
/* 3 */ DRAGONFLY_ANIM_ATTACK,
/* 4 */ DRAGONFLY_ANIM_HOVER,
/* 5 */ DRAGONFLY_ANIM_DAMAGE,
/* 6 */ DRAGONFLY_ANIM_DEAD,
/* 7 */ DRAGONFLY_ANIM_FALL
} EnGrasshopperAnim;
static s32 sOccupiedIndices[] = {
false, false, false, false, false,
};
static s8 sLimbIndexToShadowBodyPartsIndex[DRAGONFLY_LIMB_MAX] = {
-1, -1, 0, 1, 2, 3, 4, 5, -1, -1, 6, 7, -1, 8, 9, -1, 10, 11, -1, 12, 13, -1, -1, -1,
static s8 sLimbToShadowBodyParts[DRAGONFLY_LIMB_MAX] = {
BODYPART_NONE, // DRAGONFLY_LIMB_NONE
BODYPART_NONE, // DRAGONFLY_LIMB_ROOT
DRAGONFLY_SHADOW_BODYPART_0, // DRAGONFLY_LIMB_TAIL_SEGMENT_1
DRAGONFLY_SHADOW_BODYPART_1, // DRAGONFLY_LIMB_TAIL_SEGMENT_2
DRAGONFLY_SHADOW_BODYPART_2, // DRAGONFLY_LIMB_TAIL_SEGMENT_3
DRAGONFLY_SHADOW_BODYPART_3, // DRAGONFLY_LIMB_TAIL_SEGMENT_4
DRAGONFLY_SHADOW_BODYPART_4, // DRAGONFLY_LIMB_TAIL_TIP
DRAGONFLY_SHADOW_BODYPART_5, // DRAGONFLY_LIMB_THORAX
BODYPART_NONE, // DRAGONFLY_LIMB_LEFT_WING
BODYPART_NONE, // DRAGONFLY_LIMB_RIGHT_WING
DRAGONFLY_SHADOW_BODYPART_6, // DRAGONFLY_LIMB_BACK_LEFT_UPPER_LEG
DRAGONFLY_SHADOW_BODYPART_7, // DRAGONFLY_LIMB_BACK_LEFT_LOWER_LEG
BODYPART_NONE, // DRAGONFLY_LIMB_BACK_LEFT_FOOT
DRAGONFLY_SHADOW_BODYPART_8, // DRAGONFLY_LIMB_BACK_RIGHT_UPPER_LEG
DRAGONFLY_SHADOW_BODYPART_9, // DRAGONFLY_LIMB_BACK_RIGHT_LOWER_LEG
BODYPART_NONE, // DRAGONFLY_LIMB_BACK_RIGHT_FOOT
DRAGONFLY_SHADOW_BODYPART_10, // DRAGONFLY_LIMB_FRONT_LEFT_UPPER_LEG
DRAGONFLY_SHADOW_BODYPART_11, // DRAGONFLY_LIMB_FRONT_LEFT_LOWER_LEG
BODYPART_NONE, // DRAGONFLY_LIMB_FRONT_LEFT_FOOT
DRAGONFLY_SHADOW_BODYPART_12, // DRAGONFLY_LIMB_FRONT_RIGHT_UPPER_LEG
DRAGONFLY_SHADOW_BODYPART_13, // DRAGONFLY_LIMB_FRONT_RIGHT_LOWER_LEG
BODYPART_NONE, // DRAGONFLY_LIMB_FRONT_RIGHT_FOOT
BODYPART_NONE, // DRAGONFLY_LIMB_HEAD
BODYPART_NONE, // DRAGONFLY_LIMB_JAW
};
static s8 sParentBodyParts[DRAGONFLY_LIMB_MAX] = {
-1, -1, -1, 0, 1, 2, 3, -1, -1, -1, -1, 6, -1, -1, 8, -1, -1, 10, -1, -1, 12, -1, -1, -1,
// Should be `DRAGONFLY_SHADOW_BODYPART_MAX`
static s8 sParentShadowBodyParts[DRAGONFLY_LIMB_MAX] = {
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_0
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_1
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_2
DRAGONFLY_SHADOW_BODYPART_0, // DRAGONFLY_SHADOW_BODYPART_3
DRAGONFLY_SHADOW_BODYPART_1, // DRAGONFLY_SHADOW_BODYPART_4
DRAGONFLY_SHADOW_BODYPART_2, // DRAGONFLY_SHADOW_BODYPART_5
DRAGONFLY_SHADOW_BODYPART_3, // DRAGONFLY_SHADOW_BODYPART_6
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_7
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_8
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_9
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_10
DRAGONFLY_SHADOW_BODYPART_6, // DRAGONFLY_SHADOW_BODYPART_11
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_12
BODYPART_NONE, // DRAGONFLY_SHADOW_BODYPART_13
DRAGONFLY_SHADOW_BODYPART_8, //
BODYPART_NONE, //
BODYPART_NONE, //
DRAGONFLY_SHADOW_BODYPART_10, //
BODYPART_NONE, //
BODYPART_NONE, //
DRAGONFLY_SHADOW_BODYPART_12, //
BODYPART_NONE, //
BODYPART_NONE, //
BODYPART_NONE, //
};
// Should be `DRAGONFLY_SHADOW_BODYPART_MAX`
static u8 sShadowSizes[DRAGONFLY_LIMB_MAX] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, // DRAGONFLY_SHADOW_BODYPART_0
0, // DRAGONFLY_SHADOW_BODYPART_1
0, // DRAGONFLY_SHADOW_BODYPART_2
0, // DRAGONFLY_SHADOW_BODYPART_3
0, // DRAGONFLY_SHADOW_BODYPART_4
0, // DRAGONFLY_SHADOW_BODYPART_5
0, // DRAGONFLY_SHADOW_BODYPART_6
0, // DRAGONFLY_SHADOW_BODYPART_7
0, // DRAGONFLY_SHADOW_BODYPART_8
0, // DRAGONFLY_SHADOW_BODYPART_9
0, // DRAGONFLY_SHADOW_BODYPART_10
0, // DRAGONFLY_SHADOW_BODYPART_11
0, // DRAGONFLY_SHADOW_BODYPART_12
0, // DRAGONFLY_SHADOW_BODYPART_13
0, //
0, //
0, //
0, //
0, //
0, //
0, //
0, //
0, //
0, //
};
typedef enum {
/* 0x0 */ EN_GRASSHOPPER_DMGEFF_IMMUNE, // Deals no damage
/* 0x2 */ EN_GRASSHOPPER_DMGEFF_FIRE = 0x2, // Damages and sets the Dragonfly on fire
/* 0x3 */ EN_GRASSHOPPER_DMGEFF_FREEZE, // Damages and freezes the Dragonfly in ice
/* 0x4 */ EN_GRASSHOPPER_DMGEFF_LIGHT_ORB, // Damages and surrounds the Dragonfly with light orbs
/* 0xE */ EN_GRASSHOPPER_DMGEFF_HOOK = 0xE, // If hit by the Hookshot, it pulls the Dragonfly towards the player
/* 0xF */ EN_GRASSHOPPER_DMGEFF_NONE // Deals regular damage with no extra effect
/* 0x0 */ DRAGONFLY_DMGEFF_IMMUNE, // Deals no damage
/* 0x2 */ DRAGONFLY_DMGEFF_FIRE = 0x2, // Damages and sets the Dragonfly on fire
/* 0x3 */ DRAGONFLY_DMGEFF_FREEZE, // Damages and freezes the Dragonfly in ice
/* 0x4 */ DRAGONFLY_DMGEFF_LIGHT_ORB, // Damages and surrounds the Dragonfly with light orbs
/* 0xE */ DRAGONFLY_DMGEFF_HOOK = 0xE, // If hit by the Hookshot, it pulls the Dragonfly towards the player
/* 0xF */ DRAGONFLY_DMGEFF_NONE // Deals regular damage with no extra effect
} EnDragonflyDamageEffect;
static DamageTable sDamageTable = {
/* Deku Nut */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Deku Stick */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Horse trample */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Explosives */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Zora boomerang */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Normal arrow */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* UNK_DMG_0x06 */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Hookshot */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_HOOK),
/* Goron punch */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Sword */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Goron pound */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_NONE),
/* Fire arrow */ DMG_ENTRY(2, EN_GRASSHOPPER_DMGEFF_FIRE),
/* Ice arrow */ DMG_ENTRY(2, EN_GRASSHOPPER_DMGEFF_FREEZE),
/* Light arrow */ DMG_ENTRY(2, EN_GRASSHOPPER_DMGEFF_LIGHT_ORB),
/* Goron spikes */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Deku spin */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Deku bubble */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Deku launch */ DMG_ENTRY(2, EN_GRASSHOPPER_DMGEFF_NONE),
/* UNK_DMG_0x12 */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Zora barrier */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Normal shield */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Light ray */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Thrown object */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Zora punch */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Spin attack */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_NONE),
/* Sword beam */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Normal Roll */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* UNK_DMG_0x1B */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Unblockable */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* UNK_DMG_0x1E */ DMG_ENTRY(0, EN_GRASSHOPPER_DMGEFF_IMMUNE),
/* Powder Keg */ DMG_ENTRY(1, EN_GRASSHOPPER_DMGEFF_HOOK),
/* Deku Nut */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Deku Stick */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Horse trample */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Explosives */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Zora boomerang */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Normal arrow */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* UNK_DMG_0x06 */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Hookshot */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_HOOK),
/* Goron punch */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Sword */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Goron pound */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_NONE),
/* Fire arrow */ DMG_ENTRY(2, DRAGONFLY_DMGEFF_FIRE),
/* Ice arrow */ DMG_ENTRY(2, DRAGONFLY_DMGEFF_FREEZE),
/* Light arrow */ DMG_ENTRY(2, DRAGONFLY_DMGEFF_LIGHT_ORB),
/* Goron spikes */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Deku spin */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Deku bubble */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Deku launch */ DMG_ENTRY(2, DRAGONFLY_DMGEFF_NONE),
/* UNK_DMG_0x12 */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Zora barrier */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Normal shield */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Light ray */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Thrown object */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Zora punch */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Spin attack */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_NONE),
/* Sword beam */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Normal Roll */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* UNK_DMG_0x1B */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* UNK_DMG_0x1C */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Unblockable */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* UNK_DMG_0x1E */ DMG_ENTRY(0, DRAGONFLY_DMGEFF_IMMUNE),
/* Powder Keg */ DMG_ENTRY(1, DRAGONFLY_DMGEFF_HOOK),
};
ActorInit En_Grasshopper_InitVars = {
@@ -211,7 +282,7 @@ void EnGrasshopper_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 1.0f);
this->actor.colChkInfo.damageTable = &sDamageTable;
Math_Vec3f_Copy(&this->flyingHomePos, &this->actor.home.pos);
this->action = EN_GRASSHOPPER_ACTION_FLY;
this->action = DRAGONFLY_ACTION_FLY;
this->index = -1;
for (i = 0; i < ARRAY_COUNT(sOccupiedIndices); i++) {
@@ -229,12 +300,12 @@ void EnGrasshopper_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gDragonflySkel, &gDragonflyFlyAnim, this->jointTable, this->morphTable,
DRAGONFLY_LIMB_MAX);
this->type = EN_GRASSHOPPER_GET_TYPE(&this->actor);
if (this->type < EN_GRASSHOPPER_TYPE_UNUSED_NORMAL) {
this->type = EN_GRASSHOPPER_TYPE_NORMAL;
this->type = DRAGONFLY_GET_TYPE(&this->actor);
if (this->type < DRAGONFLY_TYPE_UNUSED_NORMAL) {
this->type = DRAGONFLY_TYPE_NORMAL;
}
if (this->type != EN_GRASSHOPPER_TYPE_GROWS_WHEN_SPAWNED) {
if (this->type != DRAGONFLY_TYPE_GROWS_WHEN_SPAWNED) {
this->dragonflyScale = 0.01f;
} else {
this->dragonflyScale = 0.0f;
@@ -263,25 +334,25 @@ void EnGrasshopper_Destroy(Actor* thisx, PlayState* play) {
}
static AnimationHeader* sAnimations[] = {
&gDragonflyRaiseTailAnim, // EN_GRASSHOPPER_ANIM_RAISE_TAIL
&gDragonflyLowerTailAnim, // EN_GRASSHOPPER_ANIM_LOWER_TAIL
&gDragonflyFlyAnim, // EN_GRASSHOPPER_ANIM_FLY
&gDragonflyAttackAnim, // EN_GRASSHOPPER_ANIM_ATTACK
&gDragonflyHoverAnim, // EN_GRASSHOPPER_ANIM_HOVER
&gDragonflyDamageAnim, // EN_GRASSHOPPER_ANIM_DAMAGE
&gDragonflyDeadAnim, // EN_GRASSHOPPER_ANIM_DEAD
&gDragonflyFallAnim, // EN_GRASSHOPPER_ANIM_FALL
&gDragonflyRaiseTailAnim, // DRAGONFLY_ANIM_RAISE_TAIL
&gDragonflyLowerTailAnim, // DRAGONFLY_ANIM_LOWER_TAIL
&gDragonflyFlyAnim, // DRAGONFLY_ANIM_FLY
&gDragonflyAttackAnim, // DRAGONFLY_ANIM_ATTACK
&gDragonflyHoverAnim, // DRAGONFLY_ANIM_HOVER
&gDragonflyDamageAnim, // DRAGONFLY_ANIM_DAMAGE
&gDragonflyDeadAnim, // DRAGONFLY_ANIM_DEAD
&gDragonflyFallAnim, // DRAGONFLY_ANIM_FALL
};
static u8 sAnimationModes[] = {
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_RAISE_TAIL
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_LOWER_TAIL
ANIMMODE_LOOP, // EN_GRASSHOPPER_ANIM_FLY
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_ATTACK
ANIMMODE_LOOP, // EN_GRASSHOPPER_ANIM_HOVER
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_DAMAGE
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_DEAD
ANIMMODE_ONCE, // EN_GRASSHOPPER_ANIM_FALL
ANIMMODE_ONCE, // DRAGONFLY_ANIM_RAISE_TAIL
ANIMMODE_ONCE, // DRAGONFLY_ANIM_LOWER_TAIL
ANIMMODE_LOOP, // DRAGONFLY_ANIM_FLY
ANIMMODE_ONCE, // DRAGONFLY_ANIM_ATTACK
ANIMMODE_LOOP, // DRAGONFLY_ANIM_HOVER
ANIMMODE_ONCE, // DRAGONFLY_ANIM_DAMAGE
ANIMMODE_ONCE, // DRAGONFLY_ANIM_DEAD
ANIMMODE_ONCE, // DRAGONFLY_ANIM_FALL
};
void EnGrasshopper_ChangeAnim(EnGrasshopper* this, s32 animIndex) {
@@ -289,8 +360,8 @@ void EnGrasshopper_ChangeAnim(EnGrasshopper* this, s32 animIndex) {
this->endFrame = Animation_GetLastFrame(sAnimations[animIndex]);
morphFrames = 0.0f;
if ((animIndex == EN_GRASSHOPPER_ANIM_ATTACK) || (animIndex == EN_GRASSHOPPER_ANIM_HOVER) ||
(animIndex == EN_GRASSHOPPER_ANIM_DAMAGE)) {
if ((animIndex == DRAGONFLY_ANIM_ATTACK) || (animIndex == DRAGONFLY_ANIM_HOVER) ||
(animIndex == DRAGONFLY_ANIM_DAMAGE)) {
morphFrames = -3.0f;
}
@@ -299,19 +370,19 @@ void EnGrasshopper_ChangeAnim(EnGrasshopper* this, s32 animIndex) {
}
void EnGrasshopper_RaiseTail(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_RAISE_TAIL);
if (this->decision != EN_GRASSHOPPER_DECISION_ROAM_IN_CIRCLES) {
this->decision = EN_GRASSHOPPER_DECISION_FLY;
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_RAISE_TAIL);
if (this->decision != DRAGONFLY_DECISION_ROAM_IN_CIRCLES) {
this->decision = DRAGONFLY_DECISION_FLY;
}
this->action = EN_GRASSHOPPER_ACTION_DECIDE_ACTION;
this->action = DRAGONFLY_ACTION_DECIDE_ACTION;
this->actionFunc = EnGrasshopper_DecideAction;
}
void EnGrasshopper_LowerTail(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_LOWER_TAIL);
this->action = EN_GRASSHOPPER_ACTION_DECIDE_ACTION;
this->decision = EN_GRASSHOPPER_DECISION_ATTACK;
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_LOWER_TAIL);
this->action = DRAGONFLY_ACTION_DECIDE_ACTION;
this->decision = DRAGONFLY_DECISION_ATTACK;
this->actionFunc = EnGrasshopper_DecideAction;
}
@@ -319,13 +390,13 @@ void EnGrasshopper_DecideAction(EnGrasshopper* this, PlayState* play) {
f32 curFrame = this->skelAnime.curFrame;
if (curFrame >= this->endFrame) {
if (this->decision == EN_GRASSHOPPER_DECISION_ATTACK) {
if (this->decision == DRAGONFLY_DECISION_ATTACK) {
EnGrasshopper_SetupAttack(this);
} else {
Math_Vec3f_Copy(&this->flyingHomePos, &this->actor.world.pos);
this->flyingHomePos.y = this->actor.floorHeight + 90.0f;
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FLY);
if (this->decision != EN_GRASSHOPPER_DECISION_ROAM_IN_CIRCLES) {
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_FLY);
if (this->decision != DRAGONFLY_DECISION_ROAM_IN_CIRCLES) {
if (Player_GetMask(play) == PLAYER_MASK_STONE) {
EnGrasshopper_SetupFly(this);
} else {
@@ -333,8 +404,8 @@ void EnGrasshopper_DecideAction(EnGrasshopper* this, PlayState* play) {
}
} else {
this->timer = 0;
this->action = EN_GRASSHOPPER_ACTION_ROAM_IN_CIRCLES;
this->decision = EN_GRASSHOPPER_DECISION_ATTACK;
this->action = DRAGONFLY_ACTION_ROAM_IN_CIRCLES;
this->decision = DRAGONFLY_DECISION_ATTACK;
this->waitTimer = this->timer;
this->actionFunc = EnGrasshopper_RoamInCircles;
}
@@ -343,9 +414,9 @@ void EnGrasshopper_DecideAction(EnGrasshopper* this, PlayState* play) {
}
void EnGrasshopper_SetupFly(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FLY);
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_FLY);
this->baseFlyHeight = Rand_CenteredFloat(50.0f) + this->flyingHomePos.y;
this->action = EN_GRASSHOPPER_ACTION_FLY;
this->action = DRAGONFLY_ACTION_FLY;
this->actionFunc = EnGrasshopper_Fly;
}
@@ -358,8 +429,7 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG);
diffX = this->flyingHomePos.x - this->actor.world.pos.x;
diffZ = this->flyingHomePos.z - this->actor.world.pos.z;
if ((this->type != EN_GRASSHOPPER_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) &&
(this->type != EN_GRASSHOPPER_TYPE_WOODFALL)) {
if ((this->type != DRAGONFLY_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) && (this->type != DRAGONFLY_TYPE_WOODFALL)) {
this->bobPhase += 0xAF0;
this->targetPosY = (Math_SinS(this->bobPhase) * 10.0f) + this->baseFlyHeight;
Math_ApproachF(&this->actor.world.pos.y, this->targetPosY, 0.1f, 10.0f);
@@ -377,8 +447,8 @@ void EnGrasshopper_Fly(EnGrasshopper* this, PlayState* play) {
this->shouldTurn = false;
}
//! @bug Unreachable code. To get here, the type must NOT be EN_GRASSHOPPER_TYPE_WOODFALL
if (this->type == EN_GRASSHOPPER_TYPE_WOODFALL) {
//! @bug Unreachable code. To get here, the type must NOT be DRAGONFLY_TYPE_WOODFALL
if (this->type == DRAGONFLY_TYPE_WOODFALL) {
if (sqrtf(SQ(this->actor.world.pos.x) + SQ(this->actor.world.pos.z)) < 600.0f) {
this->shouldTurn = true;
}
@@ -478,8 +548,8 @@ void EnGrasshopper_RoamInCircles(EnGrasshopper* this, PlayState* play) {
void EnGrasshopper_SetupBank(EnGrasshopper* this) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG);
this->targetBankRot.y = this->actor.world.rot.y + 0x8000;
this->action = EN_GRASSHOPPER_ACTION_BANK;
this->bankState = EN_GRASSHOPPER_BANK_STATE_BANKING;
this->action = DRAGONFLY_ACTION_BANK;
this->bankState = DRAGONFLY_BANK_STATE_BANKING;
this->actor.speed = 2.0f;
this->actionFunc = EnGrasshopper_Bank;
}
@@ -491,21 +561,21 @@ void EnGrasshopper_SetupBank(EnGrasshopper* this) {
void EnGrasshopper_Bank(EnGrasshopper* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_FLY - SFX_FLAG);
switch (this->bankState) {
case EN_GRASSHOPPER_BANK_STATE_BANKING:
case DRAGONFLY_BANK_STATE_BANKING:
Math_SmoothStepToS(&this->actor.world.rot.y, this->targetBankRot.y, 0x64, 0x3E8, 0x3E8);
Math_SmoothStepToS(&this->actor.world.rot.z, 0x4000, 0x64, 0x1F40, 0xBB8);
if (fabsf(this->actor.world.rot.y - (f32)this->targetBankRot.y) < 10.0f) {
this->postBankTimer = 100;
this->bankState = EN_GRASSHOPPER_BANK_STATE_DONE;
this->bankState = DRAGONFLY_BANK_STATE_DONE;
}
break;
case EN_GRASSHOPPER_BANK_STATE_DONE:
case DRAGONFLY_BANK_STATE_DONE:
Math_SmoothStepToS(&this->actor.world.rot.z, 0, 0x64, 0x1F40, 0xBB8);
if (this->postBankTimer == 0) {
this->timer = 0;
this->action = EN_GRASSHOPPER_ACTION_ROAM_IN_CIRCLES;
this->decision = EN_GRASSHOPPER_DECISION_ATTACK;
this->action = DRAGONFLY_ACTION_ROAM_IN_CIRCLES;
this->decision = DRAGONFLY_DECISION_ATTACK;
this->waitTimer = this->timer;
this->actionFunc = EnGrasshopper_RoamInCircles;
}
@@ -520,7 +590,7 @@ void EnGrasshopper_SetupBounced(EnGrasshopper* this) {
this->targetRot.y = -this->actor.yawTowardsPlayer;
this->timer = Rand_S16Offset(30, 30);
this->targetRot.z = (this->actor.world.rot.y - this->targetRot.y) * 0.2f;
this->action = EN_GRASSHOPPER_ACTION_BOUNCED;
this->action = DRAGONFLY_ACTION_BOUNCED;
this->actionFunc = EnGrasshopper_Bounced;
}
@@ -540,7 +610,7 @@ void EnGrasshopper_Bounced(EnGrasshopper* this, PlayState* play) {
if (this->timer == 0) {
this->collider.elements[0].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD);
this->timer = 0;
this->action = EN_GRASSHOPPER_ACTION_ROAM_IN_CIRCLES;
this->action = DRAGONFLY_ACTION_ROAM_IN_CIRCLES;
this->waitTimer = this->timer;
this->actionFunc = EnGrasshopper_RoamInCircles;
}
@@ -551,7 +621,7 @@ void EnGrasshopper_SetupApproachPlayer(EnGrasshopper* this, PlayState* play) {
Player* player = GET_PLAYER(play);
this->timer = 50;
this->action = EN_GRASSHOPPER_ACTION_APPROACH_PLAYER;
this->action = DRAGONFLY_ACTION_APPROACH_PLAYER;
this->approachSpeed = 0.0f;
this->targetApproachPos.x = (Math_SinS(player->actor.shape.rot.y) * 130.0f) + player->actor.world.pos.x;
this->targetApproachPos.z = (Math_CosS(player->actor.shape.rot.y) * 130.0f) + player->actor.world.pos.z;
@@ -602,7 +672,7 @@ void EnGrasshopper_ApproachPlayer(EnGrasshopper* this, PlayState* play) {
}
void EnGrasshopper_SetupAttack(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_ATTACK);
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_ATTACK);
this->approachSpeed = 0.0f;
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 0xA, 0xFA0, 0xA);
this->actor.speed = 3.0f;
@@ -610,7 +680,7 @@ void EnGrasshopper_SetupAttack(EnGrasshopper* this) {
this->collider.elements[0].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD);
this->collider.elements[1].info.toucherFlags |= (TOUCH_ON | TOUCH_SFX_WOOD);
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_ATTACK);
this->action = EN_GRASSHOPPER_ACTION_ATTACK;
this->action = DRAGONFLY_ACTION_ATTACK;
this->actionFunc = EnGrasshopper_Attack;
}
@@ -671,11 +741,11 @@ void EnGrasshopper_Attack(EnGrasshopper* this, PlayState* play) {
}
void EnGrasshopper_SetupWaitAfterAttack(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_HOVER);
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_HOVER);
this->bobPhase += 0xAF0;
this->targetPosY = (Math_SinS(this->bobPhase) * 10.0f) + this->baseFlyHeight;
Math_ApproachF(&this->actor.world.pos.y, this->targetPosY, 0.1f, 10.0f);
this->action = EN_GRASSHOPPER_ACTION_WAIT_AFTER_ATTACK;
this->action = DRAGONFLY_ACTION_WAIT_AFTER_ATTACK;
this->waitTimer = 20;
this->actor.speed = 0.0f;
this->collider.elements[1].info.toucherFlags &= ~(TOUCH_ON | TOUCH_SFX_WOOD);
@@ -698,7 +768,7 @@ void EnGrasshopper_WaitAfterAttack(EnGrasshopper* this, PlayState* play) {
void EnGrasshopper_SetupDamaged(EnGrasshopper* this, PlayState* play) {
Vec3f damagedVelocity;
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DAMAGE);
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_DAMAGE);
this->actor.speed = 0.0f;
this->actor.flags |= ACTOR_FLAG_1;
this->approachSpeed = 0.0f;
@@ -709,13 +779,13 @@ void EnGrasshopper_SetupDamaged(EnGrasshopper* this, PlayState* play) {
if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) &&
(this->drawDmgEffTimer != 0)) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DRAGONFLY_BODYPART_MAX, 2, 0.3f, 0.2f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8);
this->action = EN_GRASSHOPPER_ACTION_DAMAGED;
this->action = DRAGONFLY_ACTION_DAMAGED;
this->actionFunc = EnGrasshopper_Damaged;
}
@@ -727,7 +797,7 @@ void EnGrasshopper_Damaged(EnGrasshopper* this, PlayState* play) {
}
void EnGrasshopper_SetupDead(EnGrasshopper* this, PlayState* play) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_DEAD);
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_DEAD);
this->actor.flags |= ACTOR_FLAG_CANT_LOCK_ON;
this->actor.speed = 0.0f;
this->approachSpeed = 0.0f;
@@ -742,7 +812,7 @@ void EnGrasshopper_SetupDead(EnGrasshopper* this, PlayState* play) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 25);
Enemy_StartFinishingBlow(play, &this->actor);
Actor_PlaySfx(&this->actor, NA_SE_EN_BATTA_DEAD);
this->action = EN_GRASSHOPPER_ACTION_DEAD;
this->action = DRAGONFLY_ACTION_DEAD;
this->actionFunc = EnGrasshopper_Dead;
}
@@ -756,7 +826,7 @@ void EnGrasshopper_Dead(EnGrasshopper* this, PlayState* play) {
if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) &&
(this->drawDmgEffTimer < 2)) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DRAGONFLY_BODYPART_MAX, 2, 0.3f, 0.2f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -768,8 +838,8 @@ void EnGrasshopper_Dead(EnGrasshopper* this, PlayState* play) {
}
void EnGrasshopper_SetupFall(EnGrasshopper* this) {
EnGrasshopper_ChangeAnim(this, EN_GRASSHOPPER_ANIM_FALL);
this->action = EN_GRASSHOPPER_ACTION_FALL;
EnGrasshopper_ChangeAnim(this, DRAGONFLY_ANIM_FALL);
this->action = DRAGONFLY_ACTION_FALL;
this->actor.speed = 0.0f;
this->approachSpeed = 0.0f;
this->actionFunc = EnGrasshopper_Fall;
@@ -811,7 +881,7 @@ void EnGrasshopper_Fall(EnGrasshopper* this, PlayState* play) {
(((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX)) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) &&
(this->drawDmgEffTimer != 0)) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, DRAGONFLY_BODYPART_MAX, 2, 0.3f, 0.2f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -853,15 +923,15 @@ void EnGrasshopper_UpdateDamage(EnGrasshopper* this, PlayState* play) {
if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT)) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->action != EN_GRASSHOPPER_ACTION_DAMAGED) && (this->action != EN_GRASSHOPPER_ACTION_DEAD) &&
(this->action != EN_GRASSHOPPER_ACTION_FALL)) {
if (this->actor.colChkInfo.damageEffect == EN_GRASSHOPPER_DMGEFF_NONE) {
if ((this->action != DRAGONFLY_ACTION_DAMAGED) && (this->action != DRAGONFLY_ACTION_DEAD) &&
(this->action != DRAGONFLY_ACTION_FALL)) {
if (this->actor.colChkInfo.damageEffect == DRAGONFLY_DMGEFF_NONE) {
attackDealsDamage = true;
} else if (this->actor.colChkInfo.damageEffect == EN_GRASSHOPPER_DMGEFF_FIRE) {
} else if (this->actor.colChkInfo.damageEffect == DRAGONFLY_DMGEFF_FIRE) {
this->drawDmgEffTimer = 40;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
attackDealsDamage = true;
} else if (this->actor.colChkInfo.damageEffect == EN_GRASSHOPPER_DMGEFF_FREEZE) {
} else if (this->actor.colChkInfo.damageEffect == DRAGONFLY_DMGEFF_FREEZE) {
if ((this->drawDmgEffType != ACTOR_DRAW_DMGEFF_BLUE_FIRE) || (this->drawDmgEffTimer == 0)) {
Actor_ApplyDamage(&this->actor);
attackDealsDamage = false;
@@ -875,7 +945,7 @@ void EnGrasshopper_UpdateDamage(EnGrasshopper* this, PlayState* play) {
EnGrasshopper_SetupDead(this, play);
return;
}
} else if (this->actor.colChkInfo.damageEffect == EN_GRASSHOPPER_DMGEFF_LIGHT_ORB) {
} else if (this->actor.colChkInfo.damageEffect == DRAGONFLY_DMGEFF_LIGHT_ORB) {
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_GRAY, 255, COLORFILTER_BUFFLAG_OPA, 25);
this->drawDmgEffTimer = 20;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_LIGHT_ORBS;
@@ -920,14 +990,14 @@ void EnGrasshopper_Update(Actor* thisx, PlayState* play) {
Math_ApproachZeroF(&this->damagedVelocity.x, 1.0f, 2.0f);
Math_ApproachZeroF(&this->damagedVelocity.y, 1.0f, 2.0f);
Math_ApproachZeroF(&this->damagedVelocity.z, 1.0f, 2.0f);
if ((this->action != EN_GRASSHOPPER_ACTION_FALL) && (this->type != EN_GRASSHOPPER_TYPE_WOODFALL)) {
if ((this->action != DRAGONFLY_ACTION_FALL) && (this->type != DRAGONFLY_TYPE_WOODFALL)) {
Actor_UpdateBgCheckInfo(play, &this->actor, 35.0f, 60.0f, 60.0f,
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8 |
UPDBGCHECKINFO_FLAG_10);
}
this->actor.shape.rot.z = this->actor.world.rot.z;
if (this->type == EN_GRASSHOPPER_TYPE_GROWS_WHEN_SPAWNED) {
if (this->type == DRAGONFLY_TYPE_GROWS_WHEN_SPAWNED) {
f32 targetScale = this->type * 0.01f;
if (targetScale >= 0.018f) {
@@ -937,15 +1007,15 @@ void EnGrasshopper_Update(Actor* thisx, PlayState* play) {
Math_ApproachF(&this->dragonflyScale, targetScale, 0.1f, 0.01f);
}
if ((this->action != EN_GRASSHOPPER_ACTION_FALL) && (this->action != EN_GRASSHOPPER_ACTION_APPROACH_PLAYER)) {
if ((this->action != DRAGONFLY_ACTION_FALL) && (this->action != DRAGONFLY_ACTION_APPROACH_PLAYER)) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 5, 0x3E8, 5);
}
EnGrasshopper_UpdateEffects(this, play);
if ((this->action != EN_GRASSHOPPER_ACTION_DEAD) && (this->action != EN_GRASSHOPPER_ACTION_FALL)) {
if ((this->action != DRAGONFLY_ACTION_DEAD) && (this->action != DRAGONFLY_ACTION_FALL)) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);
if ((this->action == EN_GRASSHOPPER_ACTION_APPROACH_PLAYER) || (this->action == EN_GRASSHOPPER_ACTION_ATTACK)) {
if ((this->action == DRAGONFLY_ACTION_APPROACH_PLAYER) || (this->action == DRAGONFLY_ACTION_ATTACK)) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
}
@@ -958,10 +1028,9 @@ void EnGrasshopper_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
Matrix_Push();
if ((this->type != EN_GRASSHOPPER_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) &&
(this->type != EN_GRASSHOPPER_TYPE_WOODFALL)) {
if ((s8)(sLimbIndexToShadowBodyPartsIndex[limbIndex] >= 0)) {
Matrix_MultVec3f(&sZeroVec3f, &this->shadowBodyPartsPos[sLimbIndexToShadowBodyPartsIndex[limbIndex]]);
if ((this->type != DRAGONFLY_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) && (this->type != DRAGONFLY_TYPE_WOODFALL)) {
if ((s8)(sLimbToShadowBodyParts[limbIndex] > BODYPART_NONE)) {
Matrix_MultVec3f(&sZeroVec3f, &this->shadowBodyPartsPos[sLimbToShadowBodyParts[limbIndex]]);
}
}
@@ -972,6 +1041,7 @@ void EnGrasshopper_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
}
Collider_UpdateSpheres(limbIndex, &this->collider);
if ((limbIndex == DRAGONFLY_LIMB_ROOT) || (limbIndex == DRAGONFLY_LIMB_TAIL_SEGMENT_2) ||
(limbIndex == DRAGONFLY_LIMB_TAIL_TIP) || (limbIndex == DRAGONFLY_LIMB_BACK_LEFT_UPPER_LEG) ||
(limbIndex == DRAGONFLY_LIMB_BACK_RIGHT_UPPER_LEG) || (limbIndex == DRAGONFLY_LIMB_FRONT_LEFT_UPPER_LEG) ||
@@ -983,25 +1053,20 @@ void EnGrasshopper_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec
// While checking for DRAGONFLY_LIMB_ROOT twice is not a bug by itself, it causes another bug below.
(limbIndex == DRAGONFLY_LIMB_ROOT)) {
//! @bug: This code only works properly if all 12 elements of bodyPartsPos are updated every frame, since
//! otherwise bodyPartsPosIndex will be non-zero at the end of a frame. Despite the fact that there are 12
//! otherwise bodyPartIndex will be non-zero at the end of a frame. Despite the fact that there are 12
//! checks in the above if-statement, only 9 of them are valid and non-duplicate, so only 9 elements of
//! bodyPartsPos are updated on each frame. As a result, three elements in bodyPartsPos will either be (0, 0, 0)
//! or be a value carried over from the previous frame.
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsPosIndex]);
this->bodyPartsPosIndex++;
if (this->bodyPartsPosIndex >= ARRAY_COUNT(this->bodyPartsPos)) {
this->bodyPartsPosIndex = 0;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartIndex++;
if (this->bodyPartIndex >= DRAGONFLY_BODYPART_MAX) {
this->bodyPartIndex = 0;
}
}
Matrix_Pop();
}
// We need to pass in 14 into SubS_GenShadowTex for the bodyPartsNum, NOT the actual size of the
// parent body parts array. This is both necessary to match and to prevent extra dots from being
// drawn with the shadow.
#define SHADOW_BODY_PARTS_NUM 14
void EnGrasshopper_Draw(Actor* thisx, PlayState* play) {
EnGrasshopper* this = THIS;
s32 i;
@@ -1011,17 +1076,17 @@ void EnGrasshopper_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, EnGrasshopper_PostLimbDraw,
&this->actor);
if ((this->type != EN_GRASSHOPPER_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) &&
(this->type != EN_GRASSHOPPER_TYPE_WOODFALL)) {
if ((this->type != DRAGONFLY_TYPE_WOODFALL_TEMPLE_FINAL_ROOM) && (this->type != DRAGONFLY_TYPE_WOODFALL)) {
Matrix_RotateXS(0, MTXMODE_NEW);
for (i = 0, shadowTexIter = shadowTex; i < SUBS_SHADOW_TEX_SIZE; i++) {
*shadowTexIter++ = 0;
*shadowTexIter = 0;
shadowTexIter++;
}
for (i = 0; i < 5; i++) {
SubS_GenShadowTex(this->shadowBodyPartsPos, &this->actor.world.pos, shadowTex, i / 5.0f,
SHADOW_BODY_PARTS_NUM, sShadowSizes, sParentBodyParts);
DRAGONFLY_SHADOW_BODYPART_MAX, sShadowSizes, sParentShadowBodyParts);
//! FAKE: Needed to fix some regs and stack
//! https://decomp.me/scratch/4wJBW
if ((shadowTex && shadowTex) && shadowTex) {}
@@ -1046,9 +1111,8 @@ void EnGrasshopper_Draw(Actor* thisx, PlayState* play) {
this->drawDmgEffFrozenSteamScale = 0.8f;
}
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, drawDmgEffAlpha,
this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, DRAGONFLY_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, drawDmgEffAlpha, this->drawDmgEffType);
}
EnGrasshopper_DrawEffects(this, play);
@@ -4,20 +4,20 @@
#include "global.h"
#include "objects/object_grasshopper/object_grasshopper.h"
#define EN_GRASSHOPPER_GET_TYPE(thisx) ((thisx)->params)
#define DRAGONFLY_GET_TYPE(thisx) ((thisx)->params)
#define EN_GRASSHOPPER_PARAMS(type) (type)
#define DRAGONFLY_PARAMS(type) (type)
struct EnGrasshopper;
typedef void (*EnGrasshopperActionFunc)(struct EnGrasshopper*, PlayState*);
typedef enum EnGrasshopperType {
/* -1 */ EN_GRASSHOPPER_TYPE_UNUSED_NORMAL = -1, // Acts exactly like EN_GRASSHOPPER_TYPE_NORMAL
/* 0 */ EN_GRASSHOPPER_TYPE_NORMAL,
/* 1 */ EN_GRASSHOPPER_TYPE_GROWS_WHEN_SPAWNED, // Spawned by EnEncount1
/* 2 */ EN_GRASSHOPPER_TYPE_WOODFALL_TEMPLE_FINAL_ROOM,
/* 3 */ EN_GRASSHOPPER_TYPE_WOODFALL
/* -1 */ DRAGONFLY_TYPE_UNUSED_NORMAL = -1, // Acts exactly like DRAGONFLY_TYPE_NORMAL
/* 0 */ DRAGONFLY_TYPE_NORMAL,
/* 1 */ DRAGONFLY_TYPE_GROWS_WHEN_SPAWNED, // Spawned by EnEncount1
/* 2 */ DRAGONFLY_TYPE_WOODFALL_TEMPLE_FINAL_ROOM,
/* 3 */ DRAGONFLY_TYPE_WOODFALL
} EnGrasshopperType;
typedef struct EnGrasshopperEffect {
@@ -30,7 +30,41 @@ typedef struct EnGrasshopperEffect {
/* 0x2E */ s16 lightningIndex;
} EnGrasshopperEffect; // size = 0x30
#define EN_GRASSHOPPER_EFFECT_COUNT 100
#define DRAGONFLY_EFFECT_COUNT 100
typedef enum EnGrasshopperBodyPart {
/* 0 */ DRAGONFLY_BODYPART_0,
/* 1 */ DRAGONFLY_BODYPART_1,
/* 2 */ DRAGONFLY_BODYPART_2,
/* 3 */ DRAGONFLY_BODYPART_3,
/* 4 */ DRAGONFLY_BODYPART_4,
/* 5 */ DRAGONFLY_BODYPART_5,
/* 6 */ DRAGONFLY_BODYPART_6,
/* 7 */ DRAGONFLY_BODYPART_7,
/* 8 */ DRAGONFLY_BODYPART_8,
/* 9 */ DRAGONFLY_BODYPART_9,
/* 10 */ DRAGONFLY_BODYPART_10,
/* 11 */ DRAGONFLY_BODYPART_11,
/* 12 */ DRAGONFLY_BODYPART_MAX
} EnGrasshopperBodyPart;
typedef enum EnGrasshopperShadowBodyPart {
/* 0 */ DRAGONFLY_SHADOW_BODYPART_0,
/* 1 */ DRAGONFLY_SHADOW_BODYPART_1,
/* 2 */ DRAGONFLY_SHADOW_BODYPART_2,
/* 3 */ DRAGONFLY_SHADOW_BODYPART_3,
/* 4 */ DRAGONFLY_SHADOW_BODYPART_4,
/* 5 */ DRAGONFLY_SHADOW_BODYPART_5,
/* 6 */ DRAGONFLY_SHADOW_BODYPART_6,
/* 7 */ DRAGONFLY_SHADOW_BODYPART_7,
/* 8 */ DRAGONFLY_SHADOW_BODYPART_8,
/* 9 */ DRAGONFLY_SHADOW_BODYPART_9,
/* 10 */ DRAGONFLY_SHADOW_BODYPART_10,
/* 11 */ DRAGONFLY_SHADOW_BODYPART_11,
/* 12 */ DRAGONFLY_SHADOW_BODYPART_12,
/* 13 */ DRAGONFLY_SHADOW_BODYPART_13,
/* 14 */ DRAGONFLY_SHADOW_BODYPART_MAX
} EnGrasshopperShadowBodyPart;
typedef struct EnGrasshopper {
/* 0x0000 */ Actor actor;
@@ -48,8 +82,8 @@ typedef struct EnGrasshopper {
/* 0x02B8 */ s16 drawDmgEffType;
/* 0x02BC */ f32 drawDmgEffScale;
/* 0x02C0 */ f32 drawDmgEffFrozenSteamScale;
/* 0x02C4 */ Vec3f bodyPartsPos[12];
/* 0x0354 */ s16 bodyPartsPosIndex;
/* 0x02C4 */ Vec3f bodyPartsPos[DRAGONFLY_BODYPART_MAX];
/* 0x0354 */ s16 bodyPartIndex;
/* 0x0356 */ s16 splashCount;
/* 0x0358 */ s16 action;
/* 0x035A */ s16 index; // Has a minor effect on speed for some reason.
@@ -68,13 +102,13 @@ typedef struct EnGrasshopper {
/* 0x03B4 */ Vec3f targetApproachPos;
/* 0x03C0 */ Vec3f tailTipPos;
/* 0x03CC */ Vec3f effectBasePos;
/* 0x03D8 */ Vec3f shadowBodyPartsPos[DRAGONFLY_LIMB_MAX];
/* 0x03D8 */ Vec3f shadowBodyPartsPos[DRAGONFLY_LIMB_MAX]; // Should be `DRAGONFLY_SHADOW_BODYPART_MAX`
/* 0x04F8 */ f32 waterSurface;
/* 0x04FC */ Vec3f damagedVelocity;
/* 0x0508 */ Vec3s targetBankRot;
/* 0x0510 */ ColliderJntSph collider;
/* 0x0530 */ ColliderJntSphElement colliderElements[2];
/* 0x0570 */ EnGrasshopperEffect effects[EN_GRASSHOPPER_EFFECT_COUNT];
/* 0x0570 */ EnGrasshopperEffect effects[DRAGONFLY_EFFECT_COUNT];
} EnGrasshopper; // size = 0x1870
#endif // Z_EN_GRASSHOPPER_H
@@ -783,26 +783,26 @@ void func_80C21468(EnHintSkb* this, PlayState* play) {
static Color_RGBA8 D_80C21E48 = { 200, 200, 255, 255 };
static Vec3f D_80C21E4C = { 0.0f, -1.0f, 0.0f };
Vec3f sp84;
s32 phi_s4;
s32 bodyPartsCount;
s16 temp_s1;
s32 i;
if (this->unk_3E8 & 2) {
phi_s4 = ARRAY_COUNT(this->limbPos) - 1;
bodyPartsCount = ENHINTSKB_BODYPART_MAX - 1;
} else {
phi_s4 = ARRAY_COUNT(this->limbPos);
bodyPartsCount = ENHINTSKB_BODYPART_MAX;
}
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < phi_s4; i++) {
temp_s1 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->limbPos[i]);
for (i = 0; i < bodyPartsCount; i++) {
temp_s1 = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyPartsPos[i]);
sp84.x = Math_SinS(temp_s1) * 3.0f;
sp84.z = Math_CosS(temp_s1) * 3.0f;
sp84.y = (Rand_ZeroOne() * 4.0f) + 4.0f;
EffectSsEnIce_Spawn(play, &this->limbPos[i], 0.6f, &sp84, &D_80C21E4C, &D_80C21E44, &D_80C21E48, 30);
EffectSsEnIce_Spawn(play, &this->bodyPartsPos[i], 0.6f, &sp84, &D_80C21E4C, &D_80C21E44, &D_80C21E48, 30);
}
}
@@ -891,11 +891,11 @@ void EnHintSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) ||
(limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) ||
(limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) {
Matrix_MultZero(&this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
} else if ((limbIndex == 11) && !(this->unk_3E8 & 2)) {
Matrix_MultVec3f(&D_80C21E70, &this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultVec3f(&D_80C21E70, &this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
}
}
}
@@ -904,13 +904,13 @@ void EnHintSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
void EnHintSkb_Draw(Actor* thisx, PlayState* play) {
EnHintSkb* this = THIS;
this->limbCount = 0;
this->bodyPartsCount = 0;
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHintSkb_OverrideLimbDraw,
EnHintSkb_PostLimbDraw, &this->actor);
if (this->drawDmgEffTimer > 0) {
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, this->limbCount, this->drawDmgEffScale, 0.5f,
this->drawDmgEffAlpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, this->bodyPartsCount, this->drawDmgEffScale,
0.5f, this->drawDmgEffAlpha, this->drawDmgEffType);
}
if (this->unk_3E8 & 4) {
@@ -9,16 +9,34 @@ typedef void (*EnHintSkbActionFunc)(struct EnHintSkb*, PlayState*);
#define ENHINTSKB_GET_FF(thisx) ((thisx)->params & 0xFF)
typedef enum EnHintSkbBodyPart {
/* 0 */ ENHINTSKB_BODYPART_0,
/* 1 */ ENHINTSKB_BODYPART_1,
/* 2 */ ENHINTSKB_BODYPART_2,
/* 3 */ ENHINTSKB_BODYPART_3,
/* 4 */ ENHINTSKB_BODYPART_4,
/* 5 */ ENHINTSKB_BODYPART_5,
/* 6 */ ENHINTSKB_BODYPART_6,
/* 7 */ ENHINTSKB_BODYPART_7,
/* 8 */ ENHINTSKB_BODYPART_8,
/* 9 */ ENHINTSKB_BODYPART_9,
/* 10 */ ENHINTSKB_BODYPART_10,
/* 11 */ ENHINTSKB_BODYPART_11,
/* 12 */ ENHINTSKB_BODYPART_12,
/* 13 */ ENHINTSKB_BODYPART_13,
/* 14 */ ENHINTSKB_BODYPART_MAX
} EnHintSkbBodyPart;
typedef struct EnHintSkb {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderJntSph collider;
/* 0x164 */ ColliderJntSphElement colliderElement[2];
/* 0x1E4 */ SkelAnime skelAnime;
/* 0x228 */ EnHintSkbActionFunc actionFunc;
/* 0x22C */ Vec3f limbPos[14];
/* 0x22C */ Vec3f bodyPartsPos[ENHINTSKB_BODYPART_MAX];
/* 0x2D4 */ f32 drawDmgEffAlpha;
/* 0x2D8 */ f32 drawDmgEffScale;
/* 0x2DC */ s32 limbCount;
/* 0x2DC */ s32 bodyPartsCount;
/* 0x2E0 */ Vec3s jointTable[20];
/* 0x358 */ Vec3s morphtable[20];
/* 0x3D0 */ UNK_TYPE1 unk3D0[0xC];
+1 -1
View File
@@ -286,7 +286,7 @@ void func_80BF14B0(EnIg* this) {
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
if (this->unk_2A8->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_2A8)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_2A8)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_2A8->focus.pos);
}
+97 -38
View File
@@ -54,14 +54,14 @@ typedef struct {
/* 0x4 */ s16 unk04;
} EnIkUnkStruct; // size = 0x8
EnIkUnkStruct sIronKnuckleArmorMarkings[] = {
{ gIronKnuckleHelmetMarkingDL, 0x0000 },
{ gIronKnuckleFrontTorsoArmorMarkingDL, 0x0000 },
{ gIronKnuckleRearTorsoArmorMarkingDL, 0x7FFF },
{ gIronKnuckleRivetsMarking2DL, 0x4000 },
{ gIronKnuckleRivetsMarking1DL, 0xC000 },
{ NULL, 0x4000 },
{ NULL, 0xC000 },
EnIkUnkStruct sIronKnuckleArmorMarkings[IRON_KNUCKLE_ARMOR_BODYPART_MAX] = {
{ gIronKnuckleHelmetMarkingDL, 0x0000 }, // IRON_KNUCKLE_ARMOR_BODYPART_HELMET
{ gIronKnuckleFrontTorsoArmorMarkingDL, 0x0000 }, // IRON_KNUCKLE_ARMOR_BODYPART_CHEST_FRONT
{ gIronKnuckleRearTorsoArmorMarkingDL, 0x7FFF }, // IRON_KNUCKLE_ARMOR_BODYPART_CHEST_BACK
{ gIronKnuckleRivetsMarking2DL, 0x4000 }, // IRON_KNUCKLE_ARMOR_BODYPART_UPPER_LEFT_PAULDRON
{ gIronKnuckleRivetsMarking1DL, -0x4000 }, // IRON_KNUCKLE_ARMOR_BODYPART_UPPER_RIGHT_PAULDRON
{ NULL, 0x4000 }, // IRON_KNUCKLE_ARMOR_BODYPART_LOWER_LEFT_PAULDRON
{ NULL, -0x4000 }, // IRON_KNUCKLE_ARMOR_BODYPART_LOWER_RIGHT_PAULDRON
};
// sIronKnuckleArmorType[PARAM_VALUE][ARMOR_SECTIONS]
@@ -307,7 +307,7 @@ void EnIk_Thaw(EnIk* this, PlayState* play) {
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, IRON_KNUCKLE_BODYPART_MAX, 2, 0.3f, 0.2f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -356,7 +356,7 @@ s32 EnIk_ChooseAttack(EnIk* this) {
void EnIk_CheckActions(EnIk* this, PlayState* play) {
if (!EnIk_IsChangingAction(this, play) && !EnIk_ChooseAttack(this)) {
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
EnIk_SetupRun(this);
} else {
EnIk_SetupWalk(this);
@@ -367,7 +367,7 @@ void EnIk_CheckActions(EnIk* this, PlayState* play) {
void EnIk_SetupIdle(EnIk* this) {
f32 frameCount = Animation_GetLastFrame(&gIronKnuckleHorizontalAttackAnim);
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
this->timer = 10;
} else {
this->timer = 0;
@@ -455,7 +455,7 @@ void EnIk_SetupVerticalAttack(EnIk* this) {
f32 playbackSpeed;
this->actor.speed = 0.0f;
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
playbackSpeed = 1.5f;
} else {
playbackSpeed = 1.2f;
@@ -487,7 +487,7 @@ void EnIk_VerticalAttack(EnIk* this, PlayState* play) {
if ((this->skelAnime.curFrame > 13.0f) && (this->skelAnime.curFrame < 23.0f)) {
this->colliderQuad.base.atFlags |= AT_ON;
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
this->actor.speed = Math_SinF((this->skelAnime.curFrame - 13.0f) * (M_PI / 20)) * 10.0f;
}
} else {
@@ -543,7 +543,7 @@ void EnIk_HorizontalDoubleAttack(EnIk* this, PlayState* play) {
}
if (((this->skelAnime.curFrame > 1.0f) && (this->skelAnime.curFrame < 9.0f)) ||
((this->skelAnime.curFrame > 12.0f) && (this->skelAnime.curFrame < 20.0f))) {
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x5DC);
this->actor.world.rot.y = this->actor.shape.rot.y;
if (this->skelAnime.curFrame > 12.0f) {
@@ -567,7 +567,7 @@ void EnIk_SetupSingleHorizontalAttack(EnIk* this) {
f32 playSpeed;
this->actor.speed = 0.0f;
if (this->drawArmorFlags) {
if (this->drawArmorFlags != 0) {
this->actor.world.rot.z = 0x1000;
playSpeed = 1.3f;
} else {
@@ -795,7 +795,7 @@ void EnIk_UpdateDamage(EnIk* this, PlayState* play) {
this->actor.colChkInfo.damageTable = &sDamageTableNoArmor;
Actor_PlaySfx(&this->actor, NA_SE_EN_IRONNACK_ARMOR_OFF_DEMO);
EnIk_SetupCutscene(this);
} else if (this->drawArmorFlags) {
} else if (this->drawArmorFlags != 0) {
if (this->actor.colChkInfo.damageEffect == DMG_EFF_ICE) {
EnIk_Freeze(this);
EnIk_SetupFrozen(this);
@@ -928,32 +928,89 @@ void EnIk_Update(Actor* thisx, PlayState* play2) {
EnIk_UpdateArmor(this, play);
}
s8 D_8092C1A8[] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 3, 5, 4, 6, 1, 2, -1, -1, 0, 0,
static s8 sLimbToArmorBodyParts[IRON_KNUCKLE_LIMB_MAX] = {
BODYPART_NONE, // IRON_KNUCKLE_LIMB_NONE
BODYPART_NONE, // IRON_KNUCKLE_LIMB_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TASSET_CENTER
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TASSET_RIGHT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_LEG
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_FOOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TASSET_LEFT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_LEG
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_FOOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UPPER_BODY_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UNK_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_HEAD_ROOT
IRON_KNUCKLE_ARMOR_BODYPART_HELMET, // IRON_KNUCKLE_LIMB_HELMET_ARMOR
BODYPART_NONE, // IRON_KNUCKLE_LIMB_HEAD
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_UPPER_ARM
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_FOREARM
BODYPART_NONE, // IRON_KNUCKLE_LIMB_AXE_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_AXE
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_HAND
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_UPPER_ARM
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_FOREARM
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_HAND
IRON_KNUCKLE_ARMOR_BODYPART_UPPER_LEFT_PAULDRON, // IRON_KNUCKLE_LIMB_UPPER_LEFT_PAULDRON
IRON_KNUCKLE_ARMOR_BODYPART_LOWER_LEFT_PAULDRON, // IRON_KNUCKLE_LIMB_LOWER_LEFT_PAULDRON
IRON_KNUCKLE_ARMOR_BODYPART_UPPER_RIGHT_PAULDRON, // IRON_KNUCKLE_LIMB_UPPER_RIGHT_PAULDRON
IRON_KNUCKLE_ARMOR_BODYPART_LOWER_RIGHT_PAULDRON, // IRON_KNUCKLE_LIMB_LOWER_RIGHT_PAULDRON
IRON_KNUCKLE_ARMOR_BODYPART_CHEST_FRONT, // IRON_KNUCKLE_LIMB_CHEST_ARMOR_FRONT
IRON_KNUCKLE_ARMOR_BODYPART_CHEST_BACK, // IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TORSO
BODYPART_NONE, // IRON_KNUCKLE_LIMB_WAIST
};
s32 EnIk_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
EnIk* this = THIS;
if (this->drawArmorFlags) {
if (D_8092C1A8[limbIndex] > 0) {
if (this->drawArmorFlags != 0) {
if (sLimbToArmorBodyParts[limbIndex] >= IRON_KNUCKLE_ARMOR_BODYPART_CHEST_FRONT) {
*dList = NULL;
}
}
return false;
}
void EnIk_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_8092C1C8 = { 2000.0f, -200.0f, -5200.0f };
static Vec3f D_8092C1D4 = { 300.0f, -200.0f, 0.0f };
static s8 limbPosIndex[] = {
-1, -1, -1, 0, 1, 2, 3, 4, 5, -1, -1, -1, 6, -1, -1, 7,
-1, -1, 8, -1, 9, 10, -1, 11, -1, 12, -1, -1, -1, -1, 0, 0,
};
static Vec3f D_8092C1C8 = { 2000.0f, -200.0f, -5200.0f };
static Vec3f D_8092C1D4 = { 300.0f, -200.0f, 0.0f };
static s8 sLimbToBodyParts[IRON_KNUCKLE_LIMB_MAX] = {
BODYPART_NONE, // IRON_KNUCKLE_LIMB_NONE
BODYPART_NONE, // IRON_KNUCKLE_LIMB_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TASSET_CENTER
IRON_KNUCKLE_BODYPART_TASSET_RIGHT, // IRON_KNUCKLE_LIMB_TASSET_RIGHT
IRON_KNUCKLE_BODYPART_RIGHT_LEG, // IRON_KNUCKLE_LIMB_RIGHT_LEG
IRON_KNUCKLE_BODYPART_RIGHT_FOOT, // IRON_KNUCKLE_LIMB_RIGHT_FOOT
IRON_KNUCKLE_BODYPART_TASSET_LEFT, // IRON_KNUCKLE_LIMB_TASSET_LEFT
IRON_KNUCKLE_BODYPART_LEFT_LEG, // IRON_KNUCKLE_LIMB_LEFT_LEG
IRON_KNUCKLE_BODYPART_LEFT_FOOT, // IRON_KNUCKLE_LIMB_LEFT_FOOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UPPER_BODY_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UNK_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_HEAD_ROOT
IRON_KNUCKLE_BODYPART_HELMET_ARMOR, // IRON_KNUCKLE_LIMB_HELMET_ARMOR
BODYPART_NONE, // IRON_KNUCKLE_LIMB_HEAD
BODYPART_NONE, // IRON_KNUCKLE_LIMB_RIGHT_UPPER_ARM
IRON_KNUCKLE_BODYPART_RIGHT_FOREARM, // IRON_KNUCKLE_LIMB_RIGHT_FOREARM
BODYPART_NONE, // IRON_KNUCKLE_LIMB_AXE_ROOT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_AXE
IRON_KNUCKLE_BODYPART_RIGHT_HAND, // IRON_KNUCKLE_LIMB_RIGHT_HAND
BODYPART_NONE, // IRON_KNUCKLE_LIMB_LEFT_UPPER_ARM
IRON_KNUCKLE_BODYPART_LEFT_FOREARM, // IRON_KNUCKLE_LIMB_LEFT_FOREARM
IRON_KNUCKLE_BODYPART_LEFT_HAND, // IRON_KNUCKLE_LIMB_LEFT_HAND
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UPPER_LEFT_PAULDRON
IRON_KNUCKLE_BODYPART_LOWER_LEFT_PAULDRON, // IRON_KNUCKLE_LIMB_LOWER_LEFT_PAULDRON
BODYPART_NONE, // IRON_KNUCKLE_LIMB_UPPER_RIGHT_PAULDRON
IRON_KNUCKLE_BODYPART_LOWER_RIGHT_PAULDRON, // IRON_KNUCKLE_LIMB_LOWER_RIGHT_PAULDRON
BODYPART_NONE, // IRON_KNUCKLE_LIMB_CHEST_ARMOR_FRONT
BODYPART_NONE, // IRON_KNUCKLE_LIMB_CHEST_ARMOR_BACK
BODYPART_NONE, // IRON_KNUCKLE_LIMB_TORSO
BODYPART_NONE, // IRON_KNUCKLE_LIMB_WAIST
};
void EnIk_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnIk* this = THIS;
s32 index = D_8092C1A8[limbIndex];
s32 armorBodyPart = sLimbToArmorBodyParts[limbIndex];
Gfx* xlu;
IronKnuckleEffect* ikEffect;
s16 sp76;
@@ -964,15 +1021,16 @@ void EnIk_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
MtxF* mf;
if (this->drawArmorFlags == 0x1) {
if (index > 0) {
ikEffect = &this->effects[index];
if (armorBodyPart >= IRON_KNUCKLE_ARMOR_BODYPART_CHEST_FRONT) {
ikEffect = &this->effects[armorBodyPart];
mf = Matrix_GetCurrent();
ikEffect->pos.x = mf->mf[3][0];
ikEffect->pos.y = mf->mf[3][1];
ikEffect->pos.z = mf->mf[3][2];
Matrix_MtxFToYXZRot(mf, &ikEffect->rot, false);
ikEffect->enabled = true;
sp76 = sIronKnuckleArmorMarkings[index].unk04 + (((s32)Rand_Next() >> 0x13) + this->actor.shape.rot.y);
sp76 =
sIronKnuckleArmorMarkings[armorBodyPart].unk04 + (((s32)Rand_Next() >> 0x13) + this->actor.shape.rot.y);
ikEffect->vel.x = Math_SinS(sp76) * 5.0f;
ikEffect->vel.y = 6.0f;
ikEffect->vel.z = Math_CosS(sp76) * 5.0f;
@@ -1004,18 +1062,19 @@ void EnIk_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
this->blurEffectSpawnLock = this->timer;
}
if (limbPosIndex[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[limbPosIndex[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if ((index == 0) ||
((index != -1) && (this->drawArmorFlags == 0) && (sIronKnuckleArmorMarkings[index].unk00 != 0))) {
if ((armorBodyPart == IRON_KNUCKLE_ARMOR_BODYPART_HELMET) ||
((armorBodyPart != BODYPART_NONE) && (this->drawArmorFlags == 0) &&
(sIronKnuckleArmorMarkings[armorBodyPart].unk00 != NULL))) {
OPEN_DISPS(play->state.gfxCtx);
xlu = POLY_XLU_DISP;
gSPMatrix(&xlu[0], Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(&xlu[1], sIronKnuckleArmorMarkings[index].unk00);
gSPDisplayList(&xlu[1], sIronKnuckleArmorMarkings[armorBodyPart].unk00);
POLY_XLU_DISP = &xlu[2];
CLOSE_DISPS(play->state.gfxCtx);
@@ -1095,7 +1154,7 @@ void EnIk_Draw(Actor* thisx, PlayState* play) {
func_800AE5A0(play);
}
func_800BC620(&this->actor.focus.pos, &sScale, 255, play);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, IRON_KNUCKLE_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);
+30 -2
View File
@@ -24,6 +24,34 @@ typedef struct {
/* 0x24 */ s32 enabled;
} IronKnuckleEffect; // size = 0x28
typedef enum IronKnuckleBodyPart {
/* 0 */ IRON_KNUCKLE_BODYPART_TASSET_RIGHT,
/* 1 */ IRON_KNUCKLE_BODYPART_RIGHT_LEG,
/* 2 */ IRON_KNUCKLE_BODYPART_RIGHT_FOOT,
/* 3 */ IRON_KNUCKLE_BODYPART_TASSET_LEFT,
/* 4 */ IRON_KNUCKLE_BODYPART_LEFT_LEG,
/* 5 */ IRON_KNUCKLE_BODYPART_LEFT_FOOT,
/* 6 */ IRON_KNUCKLE_BODYPART_HELMET_ARMOR,
/* 7 */ IRON_KNUCKLE_BODYPART_RIGHT_FOREARM,
/* 8 */ IRON_KNUCKLE_BODYPART_RIGHT_HAND,
/* 9 */ IRON_KNUCKLE_BODYPART_LEFT_FOREARM,
/* 10 */ IRON_KNUCKLE_BODYPART_LEFT_HAND,
/* 11 */ IRON_KNUCKLE_BODYPART_LOWER_LEFT_PAULDRON,
/* 12 */ IRON_KNUCKLE_BODYPART_LOWER_RIGHT_PAULDRON,
/* 13 */ IRON_KNUCKLE_BODYPART_MAX
} IronKnuckleBodyPart;
typedef enum IronKnuckleArmorBodyPart {
/* 0 */ IRON_KNUCKLE_ARMOR_BODYPART_HELMET,
/* 1 */ IRON_KNUCKLE_ARMOR_BODYPART_CHEST_FRONT,
/* 2 */ IRON_KNUCKLE_ARMOR_BODYPART_CHEST_BACK,
/* 3 */ IRON_KNUCKLE_ARMOR_BODYPART_UPPER_LEFT_PAULDRON,
/* 4 */ IRON_KNUCKLE_ARMOR_BODYPART_UPPER_RIGHT_PAULDRON,
/* 5 */ IRON_KNUCKLE_ARMOR_BODYPART_LOWER_LEFT_PAULDRON,
/* 6 */ IRON_KNUCKLE_ARMOR_BODYPART_LOWER_RIGHT_PAULDRON,
/* 7 */ IRON_KNUCKLE_ARMOR_BODYPART_MAX
} IronKnuckleArmorBodyPart;
typedef struct EnIk {
/* 0x0000 */ Actor actor;
/* 0x0144 */ SkelAnime skelAnime;
@@ -40,12 +68,12 @@ typedef struct EnIk {
/* 0x0304 */ f32 drawDmgEffAlpha;
/* 0x0308 */ f32 drawDmgEffScale;
/* 0x030C */ f32 drawDmgEffFrozenSteamScale;
/* 0x0310 */ Vec3f limbPos[13];
/* 0x0310 */ Vec3f bodyPartsPos[IRON_KNUCKLE_BODYPART_MAX];
/* 0x03AC */ ColliderCylinder colliderCylinder;
/* 0x03F8 */ ColliderQuad colliderQuad;
/* 0x0478 */ ColliderTris colliderTris;
/* 0x0498 */ ColliderTrisElement shieldColliderItems[2];
/* 0x0550 */ IronKnuckleEffect effects[7];
/* 0x0550 */ IronKnuckleEffect effects[IRON_KNUCKLE_ARMOR_BODYPART_MAX];
} EnIk; // size = 0x668
#endif // Z_EN_IK_H
@@ -1611,8 +1611,7 @@ void func_80B89280(EnKaizoku* this, PlayState* play) {
if ((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) {
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2,
0.7f, 0.4f);
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, KAIZOKU_BODYPART_MAX, 2, 0.7f, 0.4f);
this->unk_2B8 = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->picto.actor.flags |= ACTOR_FLAG_400;
@@ -1634,8 +1633,7 @@ void func_80B893CC(EnKaizoku* this, PlayState* play) {
if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) &&
(this->unk_2B8 != 0)) {
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.7f,
0.4f);
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, KAIZOKU_BODYPART_MAX, 2, 0.7f, 0.4f);
this->unk_2B8 = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->picto.actor.flags |= ACTOR_FLAG_400;
@@ -1714,8 +1712,7 @@ void func_80B8971C(EnKaizoku* this, PlayState* play) {
if (this->unk_2B8 == 0) {
return;
}
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.7f,
0.4f);
Actor_SpawnIceEffects(play, &this->picto.actor, this->bodyPartsPos, KAIZOKU_BODYPART_MAX, 2, 0.7f, 0.4f);
this->unk_2B8 = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -2117,11 +2114,11 @@ void EnKaizoku_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
(limbIndex == KAIZOKU_LIMB_0D) || (limbIndex == KAIZOKU_LIMB_0F) || (limbIndex == KAIZOKU_LIMB_11) ||
(limbIndex == KAIZOKU_LIMB_12) || (limbIndex == KAIZOKU_LIMB_L_FOOT) || (limbIndex == KAIZOKU_LIMB_14) ||
(limbIndex == KAIZOKU_LIMB_15) || (limbIndex == KAIZOKU_LIMB_R_FOOT) || (limbIndex == KAIZOKU_LIMB_17)) {
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsPosIndex]);
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartsPosIndex++;
if (this->bodyPartsPosIndex >= ARRAY_COUNT(this->bodyPartsPos)) {
this->bodyPartsPosIndex = 0;
this->bodyPartIndex++;
if (this->bodyPartIndex >= KAIZOKU_BODYPART_MAX) {
this->bodyPartIndex = 0;
}
}
}
@@ -2167,7 +2164,7 @@ void EnKaizoku_Draw(Actor* thisx, PlayState* play) {
this->drawDmgEffFrozenSteamScale = 0.8f;
}
Actor_DrawDamageEffects(play, &this->picto.actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
Actor_DrawDamageEffects(play, &this->picto.actor, this->bodyPartsPos, KAIZOKU_BODYPART_MAX,
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, drawDmgEffAlpha,
this->drawDmgEffType);
}
@@ -35,6 +35,25 @@ typedef enum EnKaizokuAnimation {
/* 19 */ EN_KAIZOKU_ANIM_MAX
} EnKaizokuAnimation;
typedef enum EnKaizokuBodyPart {
/* 0 */ KAIZOKU_BODYPART_0,
/* 1 */ KAIZOKU_BODYPART_1,
/* 2 */ KAIZOKU_BODYPART_2,
/* 3 */ KAIZOKU_BODYPART_3,
/* 4 */ KAIZOKU_BODYPART_4,
/* 5 */ KAIZOKU_BODYPART_5,
/* 6 */ KAIZOKU_BODYPART_6,
/* 7 */ KAIZOKU_BODYPART_7,
/* 8 */ KAIZOKU_BODYPART_8,
/* 9 */ KAIZOKU_BODYPART_9,
/* 10 */ KAIZOKU_BODYPART_10,
/* 11 */ KAIZOKU_BODYPART_11,
/* 12 */ KAIZOKU_BODYPART_12,
/* 13 */ KAIZOKU_BODYPART_13,
/* 14 */ KAIZOKU_BODYPART_14,
/* 15 */ KAIZOKU_BODYPART_MAX
} EnKaizokuBodyPart;
typedef struct EnKaizoku {
/* 0x000 */ PictoActor picto;
/* 0x148 */ SkelAnime skelAnime;
@@ -64,13 +83,13 @@ typedef struct EnKaizoku {
/* 0x2DC */ f32 frameCount;
/* 0x2E0 */ f32 unk_2E0;
/* 0x2E4 */ EnKaizokuAnimation animIndex;
/* 0x2E8 */ s32 bodyPartsPosIndex;
/* 0x2E8 */ s32 bodyPartIndex;
/* 0x2EC */ s32 unk_2EC;
/* 0x2F0 */ f32 unk_2F0;
/* 0x2F4 */ s16 unk_2F4;
/* 0x2F8 */ Vec3f unk_2F8;
/* 0x304 */ Vec3f unk_304;
/* 0x310 */ Vec3f bodyPartsPos[15];
/* 0x310 */ Vec3f bodyPartsPos[KAIZOKU_BODYPART_MAX];
/* 0x3C4 */ Vec3f unk_3C4;
/* 0x3D0 */ s32 blureIndex;
/* 0x3D4 */ ColliderCylinder bodyCollider;
+29 -10
View File
@@ -177,7 +177,7 @@ void func_80AD7018(EnKame* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->collider.base.colType = COLTYPE_HIT6;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, 10, 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, SNAPPER_BODYPART_MAX, 2, 0.3f, 0.2f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -764,16 +764,35 @@ s32 func_80AD8A48(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
return false;
}
static Vec3f D_80AD8E68[] = {
{ 1500.0f, 0.0f, -2000.0f }, // SNAPPER_BODYPART_5
{ 1500.0f, 0.0f, 2000.0f }, // SNAPPER_BODYPART_6
{ 1500.0f, 2000.0f, 0.0f }, // SNAPPER_BODYPART_7
{ 1500.0f, -2000.0f, 0.0f }, // SNAPPER_BODYPART_8
{ 2500.0f, 0.0f, 0.0f }, // SNAPPER_BODYPART_9
};
static s8 sLimbToBodyParts[SNAPPER_LIMB_MAX] = {
BODYPART_NONE, // SNAPPER_LIMB_NONE
BODYPART_NONE, // SNAPPER_LIMB_BODY
BODYPART_NONE, // SNAPPER_LIMB_HEAD
SNAPPER_BODYPART_JAW, // SNAPPER_LIMB_JAW
BODYPART_NONE, // SNAPPER_LIMB_EYES
BODYPART_NONE, // SNAPPER_LIMB_FRONT_LEFT_LEG
SNAPPER_BODYPART_FRONT_LEFT_FOOT, // SNAPPER_LIMB_FRONT_LEFT_FOOT
BODYPART_NONE, // SNAPPER_LIMB_FRONT_RIGHT_LEG
SNAPPER_BODYPART_FRONT_RIGHT_FOOT, // SNAPPER_LIMB_FRONT_RIGHT_FOOT
BODYPART_NONE, // SNAPPER_LIMB_BACK_LEFT_LEG
SNAPPER_BODYPART_BACK_LEFT_FOOT, // SNAPPER_LIMB_BACK_LEFT_FOOT
BODYPART_NONE, // SNAPPER_LIMB_BACK_RIGHT_LEG
SNAPPER_BODYPART_BACK_RIGHT_FOOT, // SNAPPER_LIMB_BACK_RIGHT_FOOT
};
void func_80AD8AF8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80AD8E68[] = {
{ 1500.0f, 0.0f, -2000.0f }, { 1500.0f, 0.0f, 2000.0f }, { 1500.0f, 2000.0f, 0.0f },
{ 1500.0f, -2000.0f, 0.0f }, { 2500.0f, 0.0f, 0.0f },
};
static s8 D_80AD8EA4[] = { -1, -1, -1, 0, -1, -1, 1, -1, 2, -1, 3, -1, 4 };
EnKame* this = THIS;
if (D_80AD8EA4[limbIndex] != -1) {
Matrix_MultZero(&this->limbPos[D_80AD8EA4[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == SNAPPER_LIMB_BODY) {
@@ -786,7 +805,7 @@ void func_80AD8AF8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
}
ptr2 = D_80AD8E68;
ptr = &this->limbPos[5];
ptr = &this->bodyPartsPos[SNAPPER_BODYPART_5];
for (i = 0; i < ARRAY_COUNT(D_80AD8E68); i++) {
Matrix_MultVec3f(ptr2, ptr);
ptr2++;
@@ -811,7 +830,7 @@ void EnKame_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawFlexOpa(play, this->snapperSkelAnime.skeleton, this->snapperSkelAnime.jointTable,
this->snapperSkelAnime.dListCount, func_80AD8A48, func_80AD8AF8, &this->actor);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, SNAPPER_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
if (this->actor.shape.shadowDraw == NULL) {
+15 -1
View File
@@ -8,6 +8,20 @@ struct EnKame;
typedef void (*EnKameActionFunc)(struct EnKame*, PlayState*);
typedef enum SnapperBodyPart {
/* 0 */ SNAPPER_BODYPART_JAW,
/* 1 */ SNAPPER_BODYPART_FRONT_LEFT_FOOT,
/* 2 */ SNAPPER_BODYPART_FRONT_RIGHT_FOOT,
/* 3 */ SNAPPER_BODYPART_BACK_LEFT_FOOT,
/* 4 */ SNAPPER_BODYPART_BACK_RIGHT_FOOT,
/* 5 */ SNAPPER_BODYPART_5,
/* 6 */ SNAPPER_BODYPART_6,
/* 7 */ SNAPPER_BODYPART_7,
/* 8 */ SNAPPER_BODYPART_8,
/* 9 */ SNAPPER_BODYPART_9,
/* 10 */ SNAPPER_BODYPART_MAX
} SnapperBodyPart;
typedef struct EnKame {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime snapperSkelAnime;
@@ -30,7 +44,7 @@ typedef struct EnKame {
/* 0x2B4 */ f32 drawDmgEffScale;
/* 0x2B8 */ f32 drawDmgEffFrozenSteamScale;
/* 0x2BC */ Vec3f unk_2BC;
/* 0x2C8 */ Vec3f limbPos[10];
/* 0x2C8 */ Vec3f bodyPartsPos[SNAPPER_BODYPART_MAX];
/* 0x340 */ ColliderCylinder collider;
} EnKame; // size = 0x38C
@@ -177,18 +177,18 @@ void EnKarebaba_Destroy(Actor* thisx, PlayState* play) {
}
void EnKarebaba_SpawnIceEffects(EnKarebaba* this, PlayState* play) {
s32 limbPosCount;
s32 bodyPartsCount;
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->drawDmgEffAlpha = 0.0f;
if (this->actor.params == KAREBABA_MINI) {
limbPosCount = 1;
bodyPartsCount = 1;
} else {
limbPosCount = 4;
bodyPartsCount = KAREBABA_BODYPART_MAX;
}
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, limbPosCount, 4, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, bodyPartsCount, 4, 0.3f, 0.2f);
}
}
@@ -654,7 +654,7 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) {
EnKarebaba* this = THIS;
s32 i;
s32 stemSections;
s16 limbCount;
s16 bodyPartsCount;
f32 scale = 0.01f;
OPEN_DISPS(play->state.gfxCtx);
@@ -694,7 +694,7 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, sStemDLists[i]);
Matrix_MultZero(&this->bodyPartsPos[1 + i]);
Matrix_MultZero(&this->bodyPartsPos[KAREBABA_BODYPART_1 + i]);
if ((i == 0) && (this->actionFunc == EnKarebaba_Dying)) {
Matrix_MultZero(&this->actor.focus.pos);
}
@@ -720,18 +720,18 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, gDekuBabaStemBaseDL);
Matrix_MultZero(&this->bodyPartsPos[3]);
Matrix_MultZero(&this->bodyPartsPos[KAREBABA_BODYPART_3]);
}
func_800AE5A0(play);
if (this->actor.params == KAREBABA_MINI) {
limbCount = 1;
bodyPartsCount = 1;
} else {
limbCount = ARRAY_COUNT(this->bodyPartsPos);
bodyPartsCount = KAREBABA_BODYPART_MAX;
}
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, limbCount, this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, bodyPartsCount, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
if (this->boundFloor != 0) {
@@ -14,6 +14,14 @@ typedef enum {
/* 2 */ KAREBABA_MINI
} KarebabaType;
typedef enum KarebabaBodyPart {
/* 0 */ KAREBABA_BODYPART_0,
/* 1 */ KAREBABA_BODYPART_1,
/* 2 */ KAREBABA_BODYPART_2,
/* 3 */ KAREBABA_BODYPART_3,
/* 4 */ KAREBABA_BODYPART_MAX
} KarebabaBodyPart;
typedef struct EnKarebaba {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -25,7 +33,7 @@ typedef struct EnKarebaba {
/* 0x1F0 */ f32 drawDmgEffAlpha;
/* 0x1F4 */ f32 drawDmgEffScale;
/* 0x1F8 */ f32 drawDmgEffFrozenSteamScale;
/* 0x1FC */ Vec3f bodyPartsPos[4];
/* 0x1FC */ Vec3f bodyPartsPos[KAREBABA_BODYPART_MAX];
/* 0x22C */ CollisionPoly* boundFloor;
/* 0x230 */ ColliderCylinder attackCollider;
/* 0x27C */ ColliderCylinder hurtCollider;
@@ -119,7 +119,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play) {
this->collider.dim.yShift = -20;
this->timer = 8;
this->scroll = 0.0f;
this->actor.world.pos = player->bodyPartsPos[0];
this->actor.world.pos = player->bodyPartsPos[PLAYER_BODYPART_WAIST];
this->lightColorFrac = 0.0f;
this->adjustLightsArg1 = 0.0f;
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
@@ -230,7 +230,7 @@ void EnMThunder_Charge(EnMThunder* this, PlayState* play) {
Actor* child = this->actor.child;
this->unk1B0 = player->unk_B08;
this->actor.world.pos = player->bodyPartsPos[0];
this->actor.world.pos = player->bodyPartsPos[PLAYER_BODYPART_WAIST];
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
if (!this->isCharging && (player->unk_B08 >= 0.1f)) {
@@ -380,8 +380,8 @@ void EnMThunder_Spin_Attack(EnMThunder* this, PlayState* play) {
}
if (this->timer > 0) {
this->actor.world.pos.x = player->bodyPartsPos[0].x;
this->actor.world.pos.z = player->bodyPartsPos[0].z;
this->actor.world.pos.x = player->bodyPartsPos[PLAYER_BODYPART_WAIST].x;
this->actor.world.pos.z = player->bodyPartsPos[PLAYER_BODYPART_WAIST].z;
this->timer--;
}
+1 -1
View File
@@ -455,7 +455,7 @@ void func_80BC06C4(EnNb* this) {
if (this->unk_1E8->id == ACTOR_PLAYER) {
player = (Player*)this->unk_1E8;
sp40.y = player->bodyPartsPos[7].y + 3.0f;
sp40.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_1E8->focus.pos);
}
@@ -610,29 +610,29 @@ void EnNeoReeba_UpdatePosition(EnNeoReeba* this, PlayState* play) {
void EnNeoReeba_DrawFrozenEffects(EnNeoReeba* this, PlayState* play) {
s32 i;
f32 limbPosScale = 10.0f;
f32 bodyPartPosScaleXZ = 10.0f;
f32 phi_f2 = 20.0f;
f32 drawEffectScale = 0.8f;
if (EN_NEO_REEBA_IS_LARGE(&this->actor)) {
limbPosScale *= 1.5f;
bodyPartPosScaleXZ *= 1.5f;
phi_f2 *= 1.5f;
drawEffectScale *= 1.5f;
}
for (i = 0; i < ARRAY_COUNT(this->limbPos) - 1; i++) {
this->limbPos[i] = this->actor.world.pos;
for (i = 0; i <= EN_NEO_REEBA_BODYPART_2; i++) {
this->bodyPartsPos[i] = this->actor.world.pos;
this->limbPos[i].x += limbPosScale * Math_SinS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->limbPos[i].z += limbPosScale * Math_CosS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->limbPos[i].y += 5.0f;
this->bodyPartsPos[i].x += bodyPartPosScaleXZ * Math_SinS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->bodyPartsPos[i].z += bodyPartPosScaleXZ * Math_CosS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->bodyPartsPos[i].y += 5.0f;
}
this->limbPos[ARRAY_COUNT(this->limbPos) - 1] = this->actor.world.pos;
this->limbPos[ARRAY_COUNT(this->limbPos) - 1].y += phi_f2;
this->bodyPartsPos[EN_NEO_REEBA_BODYPART_3] = this->actor.world.pos;
this->bodyPartsPos[EN_NEO_REEBA_BODYPART_3].y += phi_f2;
this->drawEffectScale = drawEffectScale;
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), drawEffectScale, 0.5f,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, EN_NEO_REEBA_BODYPART_MAX, drawEffectScale, 0.5f,
this->drawEffectAlpha, this->drawEffectType);
}
@@ -646,15 +646,15 @@ void EnNeoReeba_DrawEffects(EnNeoReeba* this, PlayState* play) {
if ((this->drawEffectType == ACTOR_DRAW_DMGEFF_FIRE) || (this->drawEffectType == ACTOR_DRAW_DMGEFF_LIGHT_ORBS) ||
(this->drawEffectType == ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_SMALL)) {
for (i = 0; i < ARRAY_COUNT(this->limbPos) - 1; i++) {
this->limbPos[i] = this->actor.world.pos;
this->limbPos[i].x += scale * Math_SinS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->limbPos[i].z += scale * Math_CosS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->limbPos[i].y += -20.0f;
for (i = 0; i <= EN_NEO_REEBA_BODYPART_2; i++) {
this->bodyPartsPos[i] = this->actor.world.pos;
this->bodyPartsPos[i].x += scale * Math_SinS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->bodyPartsPos[i].z += scale * Math_CosS(BINANG_ADD(this->actor.shape.rot.y, i * 0x5555));
this->bodyPartsPos[i].y += -20.0f;
}
this->limbPos[ARRAY_COUNT(this->limbPos) - 1] = this->actor.world.pos;
Actor_DrawDamageEffects(play, NULL, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawEffectScale, 0.5f,
this->bodyPartsPos[EN_NEO_REEBA_BODYPART_3] = this->actor.world.pos;
Actor_DrawDamageEffects(play, NULL, this->bodyPartsPos, EN_NEO_REEBA_BODYPART_MAX, this->drawEffectScale, 0.5f,
this->drawEffectAlpha, this->drawEffectType);
}
}
@@ -672,8 +672,8 @@ void EnNeoReeba_SpawnIce(EnNeoReeba* this, PlayState* play) {
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < ARRAY_COUNT(this->limbPos); i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->limbPos[i]);
for (i = 0; i < EN_NEO_REEBA_BODYPART_MAX; i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyPartsPos[i]);
xVel = Math_SinS(yaw) * 3.0f;
zVel = Math_CosS(yaw) * 3.0f;
@@ -681,7 +681,8 @@ void EnNeoReeba_SpawnIce(EnNeoReeba* this, PlayState* play) {
iceVel.x = (Rand_Centered() * 3.0f) + xVel;
iceVel.z = (Rand_Centered() * 3.0f) + zVel;
iceVel.y = (Rand_ZeroOne() * 6.0f) + 4.0f;
EffectSsEnIce_Spawn(play, &this->limbPos[i], 0.7f, &iceVel, &sIceAccel, &sIcePrimColor, &sIceEnvColor, 30);
EffectSsEnIce_Spawn(play, &this->bodyPartsPos[i], 0.7f, &iceVel, &sIceAccel, &sIcePrimColor, &sIceEnvColor,
30);
}
}
}
@@ -10,6 +10,14 @@ struct EnNeoReeba;
typedef void (*EnNeoReebaActionFunc)(struct EnNeoReeba*, PlayState*);
typedef enum EnNeoReebaBodyPart {
/* 0 */ EN_NEO_REEBA_BODYPART_0,
/* 1 */ EN_NEO_REEBA_BODYPART_1,
/* 2 */ EN_NEO_REEBA_BODYPART_2,
/* 3 */ EN_NEO_REEBA_BODYPART_3,
/* 4 */ EN_NEO_REEBA_BODYPART_MAX
} EnNeoReebaBodyPart;
typedef struct EnNeoReeba {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -19,7 +27,7 @@ typedef struct EnNeoReeba {
/* 0x2AC */ EnNeoReebaActionFunc actionFunc;
/* 0x2B0 */ Vec3f targetPos;
/* 0x2BC */ Vec3f velToTarget;
/* 0x2C8 */ Vec3f limbPos[4];
/* 0x2C8 */ Vec3f bodyPartsPos[EN_NEO_REEBA_BODYPART_MAX];
/* 0x2F8 */ f32 sinkRiseRate;
/* 0x2FC */ f32 rotationSpeed;
/* 0x300 */ f32 drawEffectAlpha;
@@ -245,7 +245,7 @@ void EnPametfrog_Thaw(EnPametfrog* this, PlayState* play) {
this->collider.base.colType = COLTYPE_HIT6;
this->collider.elements->info.elemType = ELEMTYPE_UNK1;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.3f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, GEKKO_BODYPART_MAX, 2, 0.3f, 0.2f);
}
}
@@ -1379,29 +1379,38 @@ void EnPametfrog_Update(Actor* thisx, PlayState* play) {
}
}
/* value -1: Limb Not used
* value 0: GEKKO_LIMB_WAIST
* value 1: GEKKO_LIMB_LEFT_SHIN
* value 2: GEKKO_LIMB_LEFT_FOOT
* value 3: GEKKO_LIMB_RIGHT_SHIN
* value 4: GEKKO_LIMB_RIGHT_FOOT
* value 5: GEKKO_LIMB_LEFT_UPPER_ARM
* value 6: GEKKO_LIMB_LEFT_FOREARM
* value 7: GEKKO_LIMB_LEFT_HAND
* value 8: GEKKO_LIMB_RIGHT_UPPER_ARM
* value 9: GEKKO_LIMB_RIGHT_FOREARM
* value 10: GEKKO_LIMB_RIGHT_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,
static s8 sLimbToBodyParts[GEKKO_LIMB_MAX] = {
BODYPART_NONE, // GEKKO_LIMB_NONE
BODYPART_NONE, // GEKKO_LIMB_ROOT
GEKKO_BODYPART_WAIST, // GEKKO_LIMB_WAIST
BODYPART_NONE, // GEKKO_LIMB_LEFT_THIGH
GEKKO_BODYPART_LEFT_SHIN, // GEKKO_LIMB_LEFT_SHIN
BODYPART_NONE, // GEKKO_LIMB_LEFT_ANKLE
GEKKO_BODYPART_LEFT_FOOT, // GEKKO_LIMB_LEFT_FOOT
BODYPART_NONE, // GEKKO_LIMB_RIGHT_THIGH
GEKKO_BODYPART_RIGHT_SHIN, // GEKKO_LIMB_RIGHT_SHIN
BODYPART_NONE, // GEKKO_LIMB_RIGHT_ANKLE
GEKKO_BODYPART_RIGHT_FOOT, // GEKKO_LIMB_RIGHT_FOOT
BODYPART_NONE, // GEKKO_LIMB_TORSO
GEKKO_BODYPART_LEFT_UPPER_ARM, // GEKKO_LIMB_LEFT_UPPER_ARM
GEKKO_BODYPART_LEFT_FOREARM, // GEKKO_LIMB_LEFT_FOREARM
BODYPART_NONE, // GEKKO_LIMB_LEFT_WRIST
GEKKO_BODYPART_LEFT_HAND, // GEKKO_LIMB_LEFT_HAND
GEKKO_BODYPART_RIGHT_UPPER_ARM, // GEKKO_LIMB_RIGHT_UPPER_ARM
GEKKO_BODYPART_RIGHT_FOREARM, // GEKKO_LIMB_RIGHT_FOREARM
BODYPART_NONE, // GEKKO_LIMB_RIGHT_WRIST
GEKKO_BODYPART_RIGHT_HAND, // GEKKO_LIMB_RIGHT_HAND
BODYPART_NONE, // GEKKO_LIMB_HEAD
GEKKO_BODYPART_JAW, // GEKKO_LIMB_JAW
BODYPART_NONE, // GEKKO_LIMB_LEFT_EYE
BODYPART_NONE, // GEKKO_LIMB_RIGHT_EYE
};
void EnPametfrog_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
EnPametfrog* this = THIS;
Vec3f vec;
Vec3s* center;
s8 index;
s8 bodyPartIndex;
if (limbIndex == GEKKO_LIMB_HEAD) {
Matrix_MultZero(&this->actor.focus.pos);
@@ -1417,9 +1426,9 @@ void EnPametfrog_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s
center->z = (Math_CosS(this->actor.shape.rot.y) * 35.0f) + this->actor.focus.pos.z;
}
index = limbPosIndex[limbIndex];
if (index != -1) {
Matrix_MultZero(&this->limbPos[index]);
bodyPartIndex = sLimbToBodyParts[limbIndex];
if (bodyPartIndex != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[bodyPartIndex]);
}
}
@@ -1430,6 +1439,6 @@ void EnPametfrog_Draw(Actor* thisx, PlayState* play) {
Matrix_RotateYS(this->spinYaw, MTXMODE_APPLY);
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, NULL,
EnPametfrog_PostLimbDraw, &this->actor);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, GEKKO_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
}
@@ -21,6 +21,23 @@ typedef enum {
/* 9 */ GEKKO_DEFEAT
} EnPametfrogState;
typedef enum GekkoBodyPart {
/* -1 */ GEKKO_BODYPART_NONE = -1,
/* 0 */ GEKKO_BODYPART_WAIST,
/* 1 */ GEKKO_BODYPART_LEFT_SHIN,
/* 2 */ GEKKO_BODYPART_LEFT_FOOT,
/* 3 */ GEKKO_BODYPART_RIGHT_SHIN,
/* 4 */ GEKKO_BODYPART_RIGHT_FOOT,
/* 5 */ GEKKO_BODYPART_LEFT_UPPER_ARM,
/* 6 */ GEKKO_BODYPART_LEFT_FOREARM,
/* 7 */ GEKKO_BODYPART_LEFT_HAND,
/* 8 */ GEKKO_BODYPART_RIGHT_UPPER_ARM,
/* 9 */ GEKKO_BODYPART_RIGHT_FOREARM,
/* 10 */ GEKKO_BODYPART_RIGHT_HAND,
/* 11 */ GEKKO_BODYPART_JAW,
/* 12 */ GEKKO_BODYPART_MAX
} GekkoBodyPart;
typedef struct EnPametfrog {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -44,7 +61,7 @@ typedef struct EnPametfrog {
/* 0x2D0 */ Vec3f unk_2D0; // MtxF xz/yz/zz
/* 0x2DC */ Vec3f unk_2DC; // MtxF xy/yy/zy: wallNorm/floorNorm/Base of Gekko walking???
/* 0x2E8 */ Vec3f unk_2E8; // MtxF xx/yx/zx
/* 0x2F4 */ Vec3f limbPos[12];
/* 0x2F4 */ Vec3f bodyPartsPos[GEKKO_BODYPART_MAX];
/* 0x384 */ ColliderJntSph collider;
/* 0x3A4 */ ColliderJntSphElement colElement[2];
} EnPametfrog; // size = 0x424
+47 -22
View File
@@ -243,7 +243,7 @@ void func_808971DC(EnPeehat* this, PlayState* play) {
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
this->colliderSphere.base.colType = COLTYPE_HIT6;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.5f, 0.35f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, PEEHAT_BODYPART_MAX, 2, 0.5f, 0.35f);
}
}
@@ -866,25 +866,50 @@ s32 EnPeehat_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f
return false;
}
static Vec3f D_80899570[] = {
{ 1300.0f, 1200.0f, 0.0f }, // PEEHAT_BODYPART_12
{ 1300.0f, -1200.0f, 0.0f }, // PEEHAT_BODYPART_13
{ 1300.0f, 0.0f, 1200.0f }, // PEEHAT_BODYPART_14
{ 1300.0f, 0.0f, -1200.0f }, // PEEHAT_BODYPART_15
};
static s8 sLimbToBodyParts[OBJECT_PH_LIMB_MAX] = {
BODYPART_NONE, // OBJECT_PH_LIMB_NONE
BODYPART_NONE, // OBJECT_PH_LIMB_01
BODYPART_NONE, // OBJECT_PH_LIMB_02
BODYPART_NONE, // OBJECT_PH_LIMB_03
BODYPART_NONE, // OBJECT_PH_LIMB_04
BODYPART_NONE, // OBJECT_PH_LIMB_05
BODYPART_NONE, // OBJECT_PH_LIMB_06
PEEHAT_BODYPART_0, // OBJECT_PH_LIMB_07
BODYPART_NONE, // OBJECT_PH_LIMB_08
BODYPART_NONE, // OBJECT_PH_LIMB_09
PEEHAT_BODYPART_2, // OBJECT_PH_LIMB_0A
BODYPART_NONE, // OBJECT_PH_LIMB_0B
BODYPART_NONE, // OBJECT_PH_LIMB_0C
PEEHAT_BODYPART_4, // OBJECT_PH_LIMB_0D
BODYPART_NONE, // OBJECT_PH_LIMB_0E
BODYPART_NONE, // OBJECT_PH_LIMB_0F
PEEHAT_BODYPART_6, // OBJECT_PH_LIMB_10
BODYPART_NONE, // OBJECT_PH_LIMB_11
BODYPART_NONE, // OBJECT_PH_LIMB_12
PEEHAT_BODYPART_8, // OBJECT_PH_LIMB_13
BODYPART_NONE, // OBJECT_PH_LIMB_14
BODYPART_NONE, // OBJECT_PH_LIMB_15
PEEHAT_BODYPART_10, // OBJECT_PH_LIMB_16
BODYPART_NONE, // OBJECT_PH_LIMB_17
};
void EnPeehat_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx) {
static Vec3f D_80899570[] = {
{ 1300.0f, 1200.0f, 0.0f },
{ 1300.0f, -1200.0f, 0.0f },
{ 1300.0f, 0.0f, 1200.0f },
{ 1300.0f, 0.0f, -1200.0f },
};
static s8 D_808995A0[] = {
-1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 2, -1, -1, 4, -1, -1, 6, -1, -1, 8, -1, -1, 10, -1,
};
PlayState* play = play2;
EnPeehat* this = THIS;
s32 i;
s32 index = D_808995A0[limbIndex];
s32 bodyPartIndex = sLimbToBodyParts[limbIndex];
Gfx* gfx;
if (index != -1) {
Matrix_MultVecX(2000.0f, &this->limbPos[index]);
Matrix_MultVecX(4000.0f, &this->limbPos[index + 1]);
if (bodyPartIndex != BODYPART_NONE) {
Matrix_MultVecX(2000.0f, &this->bodyPartsPos[bodyPartIndex]);
Matrix_MultVecX(4000.0f, &this->bodyPartsPos[bodyPartIndex + 1]);
}
if (limbIndex == 4) {
@@ -892,14 +917,14 @@ void EnPeehat_PostLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3s*
Matrix_MultVecZ(-5500.0f, &this->unk_2D4[1]);
} else if ((limbIndex == 3) && (thisx->params == 0)) {
Vec3f* vec = &D_80899570[0];
Vec3f* vec2 = &this->limbPos[12];
Vec3f* bodyPartPosPtr = &this->bodyPartsPos[PEEHAT_BODYPART_12];
for (i = 0; i < ARRAY_COUNT(D_80899570); i++, vec++, vec2++) {
Matrix_MultVec3f(vec, vec2);
for (i = 0; i < ARRAY_COUNT(D_80899570); i++, vec++, bodyPartPosPtr++) {
Matrix_MultVec3f(vec, bodyPartPosPtr);
}
Matrix_MultVecX(3000.0f, vec2++);
Matrix_MultVecX(-400.0f, vec2);
Matrix_MultVecX(3000.0f, bodyPartPosPtr++); // PEEHAT_BODYPART_16
Matrix_MultVecX(-400.0f, bodyPartPosPtr); // PEEHAT_BODYPART_17
OPEN_DISPS(play->state.gfxCtx);
@@ -943,11 +968,11 @@ void EnPeehat_Draw(Actor* thisx, PlayState* play) {
}
if (this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FIRE) {
for (i = 0; i < ARRAY_COUNT(this->limbPos); i++) {
this->limbPos[i].y -= 50.0f;
for (i = 0; i < PEEHAT_BODYPART_MAX; i++) {
this->bodyPartsPos[i].y -= 50.0f;
}
}
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, PEEHAT_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
}
@@ -7,6 +7,28 @@ struct EnPeehat;
typedef void (*EnPeehatActionFunc)(struct EnPeehat*, PlayState*);
typedef enum PeehatBodyPart {
/* 0 */ PEEHAT_BODYPART_0,
/* 1 */ PEEHAT_BODYPART_1,
/* 2 */ PEEHAT_BODYPART_2,
/* 3 */ PEEHAT_BODYPART_3,
/* 4 */ PEEHAT_BODYPART_4,
/* 5 */ PEEHAT_BODYPART_5,
/* 6 */ PEEHAT_BODYPART_6,
/* 7 */ PEEHAT_BODYPART_7,
/* 8 */ PEEHAT_BODYPART_8,
/* 9 */ PEEHAT_BODYPART_9,
/* 10 */ PEEHAT_BODYPART_10,
/* 11 */ PEEHAT_BODYPART_11,
/* 12 */ PEEHAT_BODYPART_12,
/* 13 */ PEEHAT_BODYPART_13,
/* 14 */ PEEHAT_BODYPART_14,
/* 15 */ PEEHAT_BODYPART_15,
/* 16 */ PEEHAT_BODYPART_16,
/* 17 */ PEEHAT_BODYPART_17,
/* 18 */ PEEHAT_BODYPART_MAX
} PeehatBodyPart;
typedef struct EnPeehat {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -28,7 +50,7 @@ typedef struct EnPeehat {
/* 0x2CC */ f32 drawDmgEffScale;
/* 0x2D0 */ f32 drawDmgEffFrozenSteamScale;
/* 0x2D4 */ Vec3f unk_2D4[2];
/* 0x2EC */ Vec3f limbPos[18];
/* 0x2EC */ Vec3f bodyPartsPos[PEEHAT_BODYPART_MAX];
/* 0x3C4 */ ColliderCylinder colliderCylinder;
/* 0x410 */ ColliderSphere colliderSphere;
/* 0x468 */ ColliderTris colliderTris;
+1 -1
View File
@@ -1076,7 +1076,7 @@ void func_80AF898C(EnPm* this) {
this->unk_372 = CLAMP(this->unk_372, -0x1FFE, 0x1FFE);
Math_Vec3f_Copy(&sp34, &this->actor.focus.pos);
if (this->unk_268->id == ACTOR_PLAYER) {
sp40.y = ((Player*)this->unk_268)->bodyPartsPos[7].y + 3.0f;
sp40.y = ((Player*)this->unk_268)->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&sp40, &this->unk_268->focus.pos);
}
@@ -1122,37 +1122,37 @@ s32 EnPoSisters_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Ve
return false;
}
#define POE_SISTERS_LIMBPOS_INVALID -1
static Vec3f D_80B1DAFC = { 1000.0f, -1700.0f, 0.0f };
static s8 sLimbToBodyParts[POE_SISTERS_LIMB_MAX] = {
BODYPART_NONE, // POE_SISTERS_LIMB_NONE
BODYPART_NONE, // POE_SISTERS_LIMB_ROOT
POE_SISTERS_BODYPART_LEFT_ARM, // POE_SISTERS_LIMB_LEFT_ARM
POE_SISTERS_BODYPART_LEFT_HAND, // POE_SISTERS_LIMB_LEFT_HAND
POE_SISTERS_BODYPART_RIGHT_UPPER_ARM, // POE_SISTERS_LIMB_RIGHT_UPPER_ARM
BODYPART_NONE, // POE_SISTERS_LIMB_RIGHT_FOREARM
POE_SISTERS_BODYPART_TORCH_ROOT, // POE_SISTERS_LIMB_TORCH_ROOT
BODYPART_NONE, // POE_SISTERS_LIMB_RIGHT_HAND
BODYPART_NONE, // POE_SISTERS_LIMB_TORCH
BODYPART_NONE, // POE_SISTERS_LIMB_MAIN_BODY
BODYPART_NONE, // POE_SISTERS_LIMB_FACE
BODYPART_NONE, // POE_SISTERS_LIMB_LOWER_BODY
};
void EnPoSisters_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static Vec3f D_80B1DAFC = { 1000.0f, -1700.0f, 0.0f };
static s8 D_80B1DB08[] = {
POE_SISTERS_LIMBPOS_INVALID,
POE_SISTERS_LIMBPOS_INVALID,
0,
1,
2,
POE_SISTERS_LIMBPOS_INVALID,
3,
POE_SISTERS_LIMBPOS_INVALID,
POE_SISTERS_LIMBPOS_INVALID,
POE_SISTERS_LIMBPOS_INVALID,
POE_SISTERS_LIMBPOS_INVALID,
POE_SISTERS_LIMBPOS_INVALID,
};
EnPoSisters* this = THIS;
s32 end;
f32 brightness;
if (D_80B1DB08[limbIndex] != POE_SISTERS_LIMBPOS_INVALID) {
Matrix_MultZero(&this->limbPos[D_80B1DB08[limbIndex]]);
if (sLimbToBodyParts[limbIndex] != BODYPART_NONE) {
Matrix_MultZero(&this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
} else if (limbIndex == POE_SISTERS_LIMB_MAIN_BODY) {
Matrix_MultVecY(-2500.0f, &this->limbPos[4]);
Matrix_MultVecY(3000.0f, &this->limbPos[5]);
Matrix_MultVecY(-2500.0f, &this->bodyPartsPos[POE_SISTERS_BODYPART_MAIN_BODY_0]);
Matrix_MultVecY(3000.0f, &this->bodyPartsPos[POE_SISTERS_BODYPART_MAIN_BODY_1]);
} else if (limbIndex == POE_SISTERS_LIMB_FACE) {
Matrix_MultVecY(-4000.0f, &this->limbPos[6]);
Matrix_MultVecY(-4000.0f, &this->bodyPartsPos[POE_SISTERS_BODYPART_FACE]);
} else if (limbIndex == POE_SISTERS_LIMB_LOWER_BODY) {
Matrix_MultVecX(3000.0f, &this->limbPos[7]);
Matrix_MultVecX(3000.0f, &this->bodyPartsPos[POE_SISTERS_BODYPART_LOWER_BODY]);
}
if ((this->actionFunc == EnPoSisters_DeathStage1) && (this->deathTimer >= 8) &&
@@ -1265,7 +1265,7 @@ void EnPoSisters_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL);
}
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, POE_SISTERS_BODYPART_MAX,
this->actor.scale.x * (1.0f / 0.007f) * this->drawDmgEffScale, 0.0f, this->drawDmgEffAlpha,
ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
@@ -19,14 +19,26 @@ typedef enum {
/* 1 */ POE_SISTERS_TYPE_JO, // red
/* 2 */ POE_SISTERS_TYPE_BETH, // blue
/* 3 */ POE_SISTERS_TYPE_AMY // green
} EnPoSisterType;
} PoeSisterType;
typedef enum {
/* 0 */ POE_SISTERS_MEG_REAL,
/* 1 */ POE_SISTERS_MEG_CLONE1,
/* 2 */ POE_SISTERS_MEG_CLONE2,
/* 3 */ POE_SISTERS_MEG_CLONE3
} EnPoSisterMegCloneID;
} PoeSisterMegCloneId;
typedef enum PoeSisterBodyPart {
/* 0 */ POE_SISTERS_BODYPART_LEFT_ARM,
/* 1 */ POE_SISTERS_BODYPART_LEFT_HAND,
/* 2 */ POE_SISTERS_BODYPART_RIGHT_UPPER_ARM,
/* 3 */ POE_SISTERS_BODYPART_TORCH_ROOT,
/* 4 */ POE_SISTERS_BODYPART_MAIN_BODY_0,
/* 5 */ POE_SISTERS_BODYPART_MAIN_BODY_1,
/* 6 */ POE_SISTERS_BODYPART_FACE,
/* 7 */ POE_SISTERS_BODYPART_LOWER_BODY,
/* 8 */ POE_SISTERS_BODYPART_MAX
} PoeSisterBodyPart;
typedef struct EnPoSisters {
/* 0x000 */ Actor actor;
@@ -58,7 +70,7 @@ typedef struct EnPoSisters {
/* 0x1DE */ Vec3s morphTable[POE_SISTERS_LIMB_MAX];
/* 0x226 */ Color_RGBA8 color;
/* 0x22C */ Vec3f firePos[8];
/* 0x28C */ Vec3f limbPos[8]; // passed to Actor_DrawDamageEffects
/* 0x28C */ Vec3f bodyPartsPos[POE_SISTERS_BODYPART_MAX];
/* 0x2EC */ f32 megDistToPlayer;
/* 0x2F0 */ f32 drawDmgEffAlpha;
/* 0x2F4 */ f32 drawDmgEffScale;
+42 -20
View File
@@ -864,16 +864,38 @@ s32 EnPoh_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
return false;
}
static s8 sLimbToBodyParts[OBJECT_PO_LIMB_MAX] = {
BODYPART_NONE, // OBJECT_PO_LIMB_NONE
BODYPART_NONE, // OBJECT_PO_LIMB_01
BODYPART_NONE, // OBJECT_PO_LIMB_02
BODYPART_NONE, // OBJECT_PO_LIMB_03
ENPOH_BODYPART_4, // OBJECT_PO_LIMB_04
ENPOH_BODYPART_5, // OBJECT_PO_LIMB_05
BODYPART_NONE, // OBJECT_PO_LIMB_06
BODYPART_NONE, // OBJECT_PO_LIMB_07
BODYPART_NONE, // OBJECT_PO_LIMB_08
ENPOH_BODYPART_0, // OBJECT_PO_LIMB_09
ENPOH_BODYPART_1, // OBJECT_PO_LIMB_0A
BODYPART_NONE, // OBJECT_PO_LIMB_0B
BODYPART_NONE, // OBJECT_PO_LIMB_0C
BODYPART_NONE, // OBJECT_PO_LIMB_0D
BODYPART_NONE, // OBJECT_PO_LIMB_0E
BODYPART_NONE, // OBJECT_PO_LIMB_0F
ENPOH_BODYPART_2, // OBJECT_PO_LIMB_10
BODYPART_NONE, // OBJECT_PO_LIMB_11
BODYPART_NONE, // OBJECT_PO_LIMB_12
ENPOH_BODYPART_3, // OBJECT_PO_LIMB_13
BODYPART_NONE, // OBJECT_PO_LIMB_14
};
static Vec3f D_80B2F734[] = {
{ -600.0f, 500.0f, 1700.0f }, // ENPOH_BODYPART_7
{ -600.0f, 500.0f, -1700.0f }, // ENPOH_BODYPART_8
{ 1000.0f, 1700.0f, 0.0f }, // ENPOH_BODYPART_9
};
void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
static s8 D_80B2F71C[] = {
-1, -1, -1, -1, 4, 5, -1, -1, -1, 0, 1, -1, -1, -1, -1, -1, 2, -1, -1, 3, -1,
};
static Vec3f D_80B2F734[] = {
{ -600.0f, 500.0f, 1700.0f },
{ -600.0f, 500.0f, -1700.0f },
{ 1000.0f, 1700.0f, 0.0f },
};
s32 temp_s3;
s32 bodyPartIndex;
Vec3f sp60;
EnPoh* this = THIS;
s32 pad;
@@ -897,21 +919,21 @@ void EnPoh_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
this->unk_199, this->unk_19A, this->unk_19B * (200.0f / 255.0f));
}
temp_s3 = D_80B2F71C[limbIndex];
if (temp_s3 != -1) {
if (temp_s3 < 4) {
Matrix_MultZero(&this->limbPos[temp_s3]);
} else if (temp_s3 == 4) {
Matrix_MultVecX(2000.0f, &this->limbPos[temp_s3]);
bodyPartIndex = sLimbToBodyParts[limbIndex];
if (bodyPartIndex != BODYPART_NONE) {
if (bodyPartIndex <= ENPOH_BODYPART_3) {
Matrix_MultZero(&this->bodyPartsPos[bodyPartIndex]);
} else if (bodyPartIndex == ENPOH_BODYPART_4) {
Matrix_MultVecX(2000.0f, &this->bodyPartsPos[bodyPartIndex]);
} else {
s32 i;
Vec3f* vec = &this->limbPos[temp_s3 + 2];
Vec3f* vec = &this->bodyPartsPos[bodyPartIndex + 2];
Vec3f* vec2 = &D_80B2F734[0];
Matrix_MultVecX(-2000.0f, &this->limbPos[temp_s3]);
Matrix_MultVecY(-2000.0f, &this->limbPos[temp_s3 + 1]);
Matrix_MultVecX(-2000.0f, &this->bodyPartsPos[bodyPartIndex]); // ENPOH_BODYPART_5
Matrix_MultVecY(-2000.0f, &this->bodyPartsPos[bodyPartIndex + 1]); // ENPOH_BODYPART_6
for (i = temp_s3 + 2; i < ARRAY_COUNT(this->limbPos); i++, vec++, vec2++) {
for (i = bodyPartIndex + 2; i < ENPOH_BODYPART_MAX; i++, vec++, vec2++) {
Matrix_MultVec3f(vec2, vec);
}
}
@@ -959,7 +981,7 @@ void EnPoh_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(&gfx[3], object_po_DL_002D28);
POLY_OPA_DISP = &gfx[4];
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENPOH_BODYPART_MAX,
this->actor.scale.x * 100.0f * this->drawDmgEffScale, 0.0f, this->drawDmgEffAlpha,
ACTOR_DRAW_DMGEFF_LIGHT_ORBS);
+15 -1
View File
@@ -7,6 +7,20 @@ struct EnPoh;
typedef void (*EnPohActionFunc)(struct EnPoh*, PlayState*);
typedef enum EnPohBodyPart {
/* 0 */ ENPOH_BODYPART_0,
/* 1 */ ENPOH_BODYPART_1,
/* 2 */ ENPOH_BODYPART_2,
/* 3 */ ENPOH_BODYPART_3,
/* 4 */ ENPOH_BODYPART_4,
/* 5 */ ENPOH_BODYPART_5,
/* 6 */ ENPOH_BODYPART_6,
/* 7 */ ENPOH_BODYPART_7,
/* 8 */ ENPOH_BODYPART_8,
/* 9 */ ENPOH_BODYPART_9,
/* 10 */ ENPOH_BODYPART_MAX
} EnPohBodyPart;
typedef struct EnPoh {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -28,7 +42,7 @@ typedef struct EnPoh {
/* 0x21A */ Vec3s morphTable[21];
/* 0x298 */ f32 drawDmgEffAlpha;
/* 0x29C */ f32 drawDmgEffScale;
/* 0x2A0 */ Vec3f limbPos[10];
/* 0x2A0 */ Vec3f bodyPartsPos[ENPOH_BODYPART_MAX];
/* 0x318 */ LightNode* lightNode;
/* 0x31C */ LightInfo lightInfo;
/* 0x32C */ ColliderCylinder colliderCylinder;
+20 -21
View File
@@ -869,8 +869,7 @@ void EnPp_StunnedOrFrozen(EnPp* this, PlayState* play) {
if ((this->secondaryTimer == 0) && (this->drawDmgEffTimer == 0)) {
if ((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.7f,
0.4f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, EN_PP_BODYPART_MAX, 2, 0.7f, 0.4f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -906,7 +905,7 @@ void EnPp_SetupDamaged(EnPp* this, PlayState* play) {
if (((this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_SFX) ||
(this->drawDmgEffType == ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) &&
(this->drawDmgEffTimer != 0)) {
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.7f, 0.4f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, EN_PP_BODYPART_MAX, 2, 0.7f, 0.4f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -1026,7 +1025,7 @@ void EnPp_Dead(EnPp* this, PlayState* play) {
return;
}
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos), 2, 0.7f, 0.4f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, EN_PP_BODYPART_MAX, 2, 0.7f, 0.4f);
this->drawDmgEffTimer = 0;
this->drawDmgEffType = ACTOR_DRAW_DMGEFF_FIRE;
}
@@ -1189,16 +1188,16 @@ void EnPp_BodyPart_Move(EnPp* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime);
if (EN_PP_GET_TYPE(&this->actor) == EN_PP_TYPE_BODY_PART_BODY) {
this->deadBodyPartDrawDmgEffCount = 10;
for (i = 0; i < ARRAY_COUNT(this->deadBodyPartDrawDmgEffPos); i++) {
Math_Vec3f_Copy(&this->deadBodyPartDrawDmgEffPos[i], &this->deadBodyPartPos);
this->deadBodyPartDrawDmgEffPos[i].x += Math_SinS(0xCCC * i) * 15.0f;
this->deadBodyPartDrawDmgEffPos[i].y += -5.0f;
this->deadBodyPartDrawDmgEffPos[i].z += Math_CosS(0xCCC * i) * 15.0f;
this->deadBodyPartCount = EN_PP_DEAD_BODYPART_MAX;
for (i = 0; i < EN_PP_DEAD_BODYPART_MAX; i++) {
Math_Vec3f_Copy(&this->deadBodyPartsPos[i], &this->deadBodyPartPos);
this->deadBodyPartsPos[i].x += Math_SinS(0xCCC * i) * 15.0f;
this->deadBodyPartsPos[i].y += -5.0f;
this->deadBodyPartsPos[i].z += Math_CosS(0xCCC * i) * 15.0f;
}
} else {
Math_Vec3f_Copy(&this->deadBodyPartDrawDmgEffPos[0], &this->deadBodyPartPos);
this->deadBodyPartDrawDmgEffCount = 1;
Math_Vec3f_Copy(&this->deadBodyPartsPos[0], &this->deadBodyPartPos);
this->deadBodyPartCount = 1;
this->actor.shape.rot.x += this->deadBodyPartRotationalVelocity.x;
this->actor.shape.rot.z += this->deadBodyPartRotationalVelocity.z;
}
@@ -1541,10 +1540,10 @@ void EnPp_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
(limbIndex == HIPLOOP_LIMB_CENTER_WING_BASE) || (limbIndex == HIPLOOP_LIMB_CENTER_WING_MIDDLE) ||
(limbIndex == HIPLOOP_LIMB_BACK_LEFT_LOWER_LEG) || (limbIndex == HIPLOOP_LIMB_RIGHT_EYE) ||
(limbIndex == HIPLOOP_LIMB_LEFT_EYE)) {
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsPosIndex]);
this->bodyPartsPosIndex++;
if (this->bodyPartsPosIndex >= ARRAY_COUNT(this->bodyPartsPos)) {
this->bodyPartsPosIndex = 0;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartIndex++;
if (this->bodyPartIndex >= EN_PP_BODYPART_MAX) {
this->bodyPartIndex = 0;
}
if ((this->action == EN_PP_ACTION_SPAWN_BODY_PARTS) && (this->deadBodyPartsSpawnedCount < 6) &&
@@ -1575,14 +1574,14 @@ void EnPp_Draw(Actor* thisx, PlayState* play) {
SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount,
EnPp_OverrideLimbDraw, EnPp_PostLimbDraw, &this->actor);
if (this->deadBodyPartDrawDmgEffCount != 0) {
if (this->deadBodyPartCount != 0) {
scale = 0.4f;
if (EN_PP_GET_TYPE(&this->actor) == EN_PP_TYPE_BODY_PART_BODY) {
scale = 0.6f;
}
Actor_DrawDamageEffects(play, &this->actor, this->deadBodyPartDrawDmgEffPos, this->deadBodyPartDrawDmgEffCount,
scale, scale, 1.0f, ACTOR_DRAW_DMGEFF_BLUE_FIRE);
Actor_DrawDamageEffects(play, &this->actor, this->deadBodyPartsPos, this->deadBodyPartCount, scale, scale, 1.0f,
ACTOR_DRAW_DMGEFF_BLUE_FIRE);
}
if (this->drawDmgEffTimer != 0) {
@@ -1600,8 +1599,8 @@ void EnPp_Draw(Actor* thisx, PlayState* play) {
this->drawDmgEffFrozenSteamScale = 0.8f;
}
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ARRAY_COUNT(this->bodyPartsPos),
this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale, alpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, EN_PP_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, alpha, this->drawDmgEffType);
}
if (this->floorPolyForCircleShadow != NULL) {
+33 -4
View File
@@ -25,6 +25,35 @@ typedef enum {
/* 26 */ EN_PP_TYPE_BODY_PART_CENTER_WING_MIDDLE = 26
} EnPpType;
typedef enum EnPpBodyPart {
/* 0 */ EN_PP_BODYPART_0,
/* 1 */ EN_PP_BODYPART_1,
/* 2 */ EN_PP_BODYPART_2,
/* 3 */ EN_PP_BODYPART_3,
/* 4 */ EN_PP_BODYPART_4,
/* 5 */ EN_PP_BODYPART_5,
/* 6 */ EN_PP_BODYPART_6,
/* 7 */ EN_PP_BODYPART_7,
/* 8 */ EN_PP_BODYPART_8,
/* 9 */ EN_PP_BODYPART_9,
/* 10 */ EN_PP_BODYPART_10,
/* 11 */ EN_PP_BODYPART_MAX
} EnPpBodyPart;
typedef enum EnPpDeadBodyPart {
/* 0 */ EN_PP_DEAD_BODYPART_0,
/* 1 */ EN_PP_DEAD_BODYPART_1,
/* 2 */ EN_PP_DEAD_BODYPART_2,
/* 3 */ EN_PP_DEAD_BODYPART_3,
/* 4 */ EN_PP_DEAD_BODYPART_4,
/* 5 */ EN_PP_DEAD_BODYPART_5,
/* 6 */ EN_PP_DEAD_BODYPART_6,
/* 7 */ EN_PP_DEAD_BODYPART_7,
/* 8 */ EN_PP_DEAD_BODYPART_8,
/* 9 */ EN_PP_DEAD_BODYPART_9,
/* 10 */ EN_PP_DEAD_BODYPART_MAX
} EnPpDeadBodyPart;
typedef struct EnPp {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -57,8 +86,8 @@ typedef struct EnPp {
/* 0x34C */ Vec3f maskVelocity;
/* 0x358 */ Vec3f targetPos;
/* 0x364 */ Vec3f deadBodyPartPos;
/* 0x370 */ s32 deadBodyPartDrawDmgEffCount;
/* 0x374 */ Vec3f deadBodyPartDrawDmgEffPos[10];
/* 0x370 */ s32 deadBodyPartCount;
/* 0x374 */ Vec3f deadBodyPartsPos[EN_PP_DEAD_BODYPART_MAX];
/* 0x3EC */ Vec3s deadBodyPartRotationalVelocity;
/* 0x3F2 */ s16 drawDmgEffTimer;
/* 0x3F4 */ s16 drawDmgEffType;
@@ -66,8 +95,8 @@ typedef struct EnPp {
/* 0x3FC */ f32 drawDmgEffFrozenSteamScale;
/* 0x400 */ f32 attackRange;
/* 0x404 */ s32 hasBeenDamaged;
/* 0x408 */ Vec3f bodyPartsPos[11];
/* 0x48C */ s16 bodyPartsPosIndex;
/* 0x408 */ Vec3f bodyPartsPos[EN_PP_BODYPART_MAX];
/* 0x48C */ s16 bodyPartIndex;
/* 0x490 */ f32 maskAccelY;
/* 0x494 */ ColliderJntSph maskCollider;
/* 0x4B4 */ ColliderJntSphElement maskColliderElements[1];
+6 -6
View File
@@ -589,10 +589,10 @@ void EnPr_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
if ((limbIndex == 0) || (limbIndex == 1) || (limbIndex == 2) || (limbIndex == 3) || (limbIndex == 4) ||
(limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) || (limbIndex == 8) || (limbIndex == 9)) {
Matrix_MultZero(&this->limbPos[this->unk_228]);
this->unk_228++;
if (this->unk_228 >= ARRAY_COUNT(this->limbPos)) {
this->unk_228 = 0;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
if (this->bodyPartsCount >= ENPR_BODYPART_MAX) {
this->bodyPartsCount = 0;
}
}
}
@@ -627,8 +627,8 @@ void EnPr_Draw(Actor* thisx, PlayState* play) {
this->unk_238 = 0.8f;
this->unk_234 = 0.8f;
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 0.8f, 0.8f,
drawDmgEffAlpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENPR_BODYPART_MAX, 0.8f, 0.8f, drawDmgEffAlpha,
this->drawDmgEffType);
}
CLOSE_DISPS(play->state.gfxCtx);
+16 -2
View File
@@ -12,6 +12,20 @@ typedef void (*EnPrActionFunc)(struct EnPr*, PlayState*);
#define ENPR_FF00_MAX 20
#define ENPR_FF00_MIN 0
typedef enum EnPrBodyPart {
/* 0 */ ENPR_BODYPART_0,
/* 1 */ ENPR_BODYPART_1,
/* 2 */ ENPR_BODYPART_2,
/* 3 */ ENPR_BODYPART_3,
/* 4 */ ENPR_BODYPART_4,
/* 5 */ ENPR_BODYPART_5,
/* 6 */ ENPR_BODYPART_6,
/* 7 */ ENPR_BODYPART_7,
/* 8 */ ENPR_BODYPART_8,
/* 9 */ ENPR_BODYPART_9,
/* 10 */ ENPR_BODYPART_MAX
} EnPrBodyPart;
typedef struct EnPr {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -31,13 +45,13 @@ typedef struct EnPr {
/* 0x218 */ UNK_TYPE1 unk218[4];
/* 0x21C */ s32 unk_21C;
/* 0x220 */ UNK_TYPE1 unk220[0x8];
/* 0x228 */ s32 unk_228;
/* 0x228 */ s32 bodyPartsCount;
/* 0x22C */ s16 unk_22C;
/* 0x22E */ s16 drawDmgEffAlpha;
/* 0x230 */ s16 drawDmgEffType;
/* 0x234 */ f32 unk_234;
/* 0x238 */ f32 unk_238;
/* 0x23C */ Vec3f limbPos[10];
/* 0x23C */ Vec3f bodyPartsPos[ENPR_BODYPART_MAX];
/* 0x2B4 */ f32 unk_2B4;
/* 0x2B8 */ f32 unk_2B8;
/* 0x2BC */ f32 unk_2BC;
@@ -878,25 +878,25 @@ void func_80B726B4(EnRailSkb* this, PlayState* play) {
static Vec3f D_80B734B8 = { 0.0f, -1.0f, 0.0f };
Vec3f sp84;
s32 i;
s32 end;
s32 bodyPartsCount;
s16 yaw;
if (this->unk_402 & 2) {
end = ARRAY_COUNT(this->limbPos) - 1;
bodyPartsCount = ENRAILSKB_BODYPART_MAX - 1;
} else {
end = ARRAY_COUNT(this->limbPos);
bodyPartsCount = ENRAILSKB_BODYPART_MAX;
}
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < end; i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->limbPos[i]);
for (i = 0; i < bodyPartsCount; i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyPartsPos[i]);
sp84.x = Math_SinS(yaw) * 3.0f;
sp84.z = Math_CosS(yaw) * 3.0f;
sp84.y = (Rand_ZeroOne() * 4.0f) + 4.0f;
EffectSsEnIce_Spawn(play, &this->limbPos[i], 0.6f, &sp84, &D_80B734B8, &D_80B734B0, &D_80B734B4, 30);
EffectSsEnIce_Spawn(play, &this->bodyPartsPos[i], 0.6f, &sp84, &D_80B734B8, &D_80B734B0, &D_80B734B4, 30);
}
}
@@ -1129,11 +1129,11 @@ void EnRailSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) ||
(limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) ||
(limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) {
Matrix_MultZero(&this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
} else if ((limbIndex == 11) && !(this->unk_402 & 2)) {
Matrix_MultVec3f(&D_80B734D0, &this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultVec3f(&D_80B734D0, &this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
}
}
}
@@ -1142,13 +1142,13 @@ void EnRailSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s*
void EnRailSkb_Draw(Actor* thisx, PlayState* play) {
EnRailSkb* this = THIS;
this->limbCount = 0;
this->bodyPartsCount = 0;
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnRailSkb_OverrideLimbDraw,
EnRailSkb_PostLimbDraw, &this->actor);
if (this->drawDmgEffTimer > 0) {
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, this->limbCount, this->drawDmgEffScale, 0.5f,
this->drawDmgEffAlpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, this->bodyPartsCount, this->drawDmgEffScale,
0.5f, this->drawDmgEffAlpha, this->drawDmgEffType);
}
if ((this->unk_402 & 0x40) && !(this->unk_402 & 0x80)) {
@@ -12,6 +12,24 @@ typedef void (*EnRailSkbUnkFunc)(struct EnRailSkb*);
#define ENRAILSKB_GET_FF00(thisx) (((thisx)->params >> 8) & 0xFF)
#define ENRAILSKB_GET_FF(thisx) ((thisx)->params & 0xFF)
typedef enum EnRailSkbBodyPart {
/* 0 */ ENRAILSKB_BODYPART_0,
/* 1 */ ENRAILSKB_BODYPART_1,
/* 2 */ ENRAILSKB_BODYPART_2,
/* 3 */ ENRAILSKB_BODYPART_3,
/* 4 */ ENRAILSKB_BODYPART_4,
/* 5 */ ENRAILSKB_BODYPART_5,
/* 6 */ ENRAILSKB_BODYPART_6,
/* 7 */ ENRAILSKB_BODYPART_7,
/* 8 */ ENRAILSKB_BODYPART_8,
/* 9 */ ENRAILSKB_BODYPART_9,
/* 10 */ ENRAILSKB_BODYPART_10,
/* 11 */ ENRAILSKB_BODYPART_11,
/* 12 */ ENRAILSKB_BODYPART_12,
/* 13 */ ENRAILSKB_BODYPART_13,
/* 14 */ ENRAILSKB_BODYPART_MAX
} EnRailSkbBodyPart;
typedef struct EnRailSkb {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderJntSph collider;
@@ -20,8 +38,8 @@ typedef struct EnRailSkb {
/* 0x228 */ EnRailSkbActionFunc actionFunc;
/* 0x22C */ ObjHakaisi* unk_22C;
/* 0x230 */ Vec3s* unk_230;
/* 0x234 */ Vec3f limbPos[14];
/* 0x2DC */ s32 limbCount;
/* 0x234 */ Vec3f bodyPartsPos[ENRAILSKB_BODYPART_MAX];
/* 0x2DC */ s32 bodyPartsCount;
/* 0x2E0 */ s32 unk_2E0;
/* 0x2E4 */ s32 unk_2E4;
/* 0x2E8 */ s32 unk_2E8;
@@ -1061,8 +1061,8 @@ void EnRailgibud_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s
(limbIndex == GIBDO_LIMB_LEFT_FOREARM) || (limbIndex == GIBDO_LIMB_LEFT_HAND) ||
(limbIndex == GIBDO_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) || (limbIndex == GIBDO_LIMB_RIGHT_FOREARM) ||
(limbIndex == GIBDO_LIMB_RIGHT_HAND) || (limbIndex == GIBDO_LIMB_HEAD) || (limbIndex == GIBDO_LIMB_PELVIS))) {
Matrix_MultZero(&this->limbPos[this->limbIndex]);
this->limbIndex++;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartIndex++;
}
}
@@ -1071,7 +1071,7 @@ void EnRailgibud_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
this->limbIndex = 0;
this->bodyPartIndex = 0;
if (this->actor.shape.shadowAlpha == 255) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
@@ -1093,7 +1093,7 @@ void EnRailgibud_Draw(Actor* thisx, PlayState* play) {
}
if (this->drawDmgEffTimer > 0) {
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, ENRAILGIBUD_BODYPART_MAX, this->drawDmgEffScale,
0.5f, this->drawDmgEffAlpha, this->drawDmgEffType);
}
@@ -12,13 +12,32 @@ typedef void (*EnRailgibudActionFunc)(struct EnRailgibud*, PlayState*);
#define ENRAILGIBUD_IS_CUTSCENE_TYPE(thisx) ((thisx)->params & 0x80)
#define ENRAILGIBUD_GET_PATH_INDEX(thisx) (((thisx)->params & 0xFF00) >> 8)
typedef enum EnRailgibudBodyPart {
/* 0 */ ENRAILGIBUD_BODYPART_0,
/* 1 */ ENRAILGIBUD_BODYPART_1,
/* 2 */ ENRAILGIBUD_BODYPART_2,
/* 3 */ ENRAILGIBUD_BODYPART_3,
/* 4 */ ENRAILGIBUD_BODYPART_4,
/* 5 */ ENRAILGIBUD_BODYPART_5,
/* 6 */ ENRAILGIBUD_BODYPART_6,
/* 7 */ ENRAILGIBUD_BODYPART_7,
/* 8 */ ENRAILGIBUD_BODYPART_8,
/* 9 */ ENRAILGIBUD_BODYPART_9,
/* 10 */ ENRAILGIBUD_BODYPART_10,
/* 11 */ ENRAILGIBUD_BODYPART_11,
/* 12 */ ENRAILGIBUD_BODYPART_12,
/* 13 */ ENRAILGIBUD_BODYPART_13,
/* 14 */ ENRAILGIBUD_BODYPART_14,
/* 15 */ ENRAILGIBUD_BODYPART_MAX
} EnRailgibudBodyPart;
typedef struct EnRailgibud {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collider;
/* 0x190 */ SkelAnime skelAnime;
/* 0x1D4 */ EnRailgibudActionFunc actionFunc;
/* 0x1D8 */ Vec3f limbPos[15];
/* 0x28C */ s32 limbIndex;
/* 0x1D8 */ Vec3f bodyPartsPos[ENRAILGIBUD_BODYPART_MAX];
/* 0x28C */ s32 bodyPartIndex;
/* 0x290 */ UNK_TYPE1 unk290[0x4];
/* 0x294 */ Vec3s* points;
/* 0x298 */ s32 currentPoint;
+5 -5
View File
@@ -1322,8 +1322,8 @@ void EnRd_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
(limbIndex == REDEAD_LIMB_RIGHT_SHOULDER_AND_UPPER_ARM) || (limbIndex == REDEAD_LIMB_RIGHT_FOREARM) ||
(limbIndex == REDEAD_LIMB_RIGHT_HAND) || (limbIndex == REDEAD_LIMB_HEAD) ||
(limbIndex == REDEAD_LIMB_PELVIS))) {
Matrix_MultZero(&this->limbPos[this->limbIndex]);
this->limbIndex++;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartIndex]);
this->bodyPartIndex++;
}
}
@@ -1335,7 +1335,7 @@ void EnRd_Draw(Actor* thisx, PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
this->limbIndex = 0;
this->bodyPartIndex = 0;
if (this->alpha == 255) {
Gfx_SetupDL25_Opa(play->state.gfxCtx);
@@ -1363,7 +1363,7 @@ void EnRd_Draw(Actor* thisx, PlayState* play) {
CLOSE_DISPS(play->state.gfxCtx);
if (this->drawDmgEffTimer > 0) {
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
0.5f, this->drawDmgEffAlpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, EN_RD_BODYPART_MAX, this->drawDmgEffScale, 0.5f,
this->drawDmgEffAlpha, this->drawDmgEffType);
}
}
+21 -2
View File
@@ -30,14 +30,33 @@ typedef enum {
/* 7 */ EN_RD_TYPE_PIROUETTE
} EnRdType;
typedef enum EnRdBodyPart {
/* 0 */ EN_RD_BODYPART_0,
/* 1 */ EN_RD_BODYPART_1,
/* 2 */ EN_RD_BODYPART_2,
/* 3 */ EN_RD_BODYPART_3,
/* 4 */ EN_RD_BODYPART_4,
/* 5 */ EN_RD_BODYPART_5,
/* 6 */ EN_RD_BODYPART_6,
/* 7 */ EN_RD_BODYPART_7,
/* 8 */ EN_RD_BODYPART_8,
/* 9 */ EN_RD_BODYPART_9,
/* 10 */ EN_RD_BODYPART_10,
/* 11 */ EN_RD_BODYPART_11,
/* 12 */ EN_RD_BODYPART_12,
/* 13 */ EN_RD_BODYPART_13,
/* 14 */ EN_RD_BODYPART_14,
/* 15 */ EN_RD_BODYPART_MAX
} EnRdBodyPart;
typedef struct EnRd {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ EnRdActionFunc actionFunc;
/* 0x18C */ EnRdSetupDanceFunc setupDanceFunc;
/* 0x190 */ ColliderCylinder collider;
/* 0x1DC */ Vec3f limbPos[15];
/* 0x290 */ s32 limbIndex;
/* 0x1DC */ Vec3f bodyPartsPos[EN_RD_BODYPART_MAX];
/* 0x290 */ s32 bodyPartIndex;
/* 0x294 */ f32 drawDmgEffAlpha;
/* 0x298 */ f32 drawDmgEffScale;
/* 0x29C */ Vec3s jointTable[REDEAD_LIMB_MAX];
+23 -18
View File
@@ -133,7 +133,7 @@ void EnRr_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitAndSetCylinder(play, &this->collider1, &this->actor, &sCylinderInit1);
Collider_InitAndSetCylinder(play, &this->collider2, &this->actor, &sCylinderInit2);
if (this->actor.params != ENRR_3) {
if (this->actor.params != LIKE_LIKE_PARAM_3) {
this->actor.scale.y = 0.015f;
this->actor.scale.x = 0.019f;
this->actor.scale.z = 0.019f;
@@ -152,9 +152,9 @@ void EnRr_Init(Actor* thisx, PlayState* play) {
Actor_SetFocus(&this->actor, this->actor.scale.y * 2000.0f);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if ((this->actor.params == ENRR_2) || (this->actor.params == ENRR_3)) {
if ((this->actor.params == LIKE_LIKE_PARAM_2) || (this->actor.params == LIKE_LIKE_PARAM_3)) {
this->actor.colChkInfo.health = 6;
if (this->actor.params == ENRR_2) {
if (this->actor.params == LIKE_LIKE_PARAM_2) {
this->actor.colChkInfo.mass = MASS_HEAVY;
}
}
@@ -208,8 +208,8 @@ void func_808FA19C(EnRr* this, PlayState* play) {
this->collider1.base.colType = COLTYPE_HIT0;
this->collider1.info.elemType = ELEMTYPE_UNK1;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, 20, 2, this->actor.scale.y * 23.333334f,
this->actor.scale.y * 20.000002f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, LIKE_LIKE_BODYPART_MAX, 2,
this->actor.scale.y * 23.333334f, this->actor.scale.y * 20.000002f);
this->actor.flags |= ACTOR_FLAG_400;
}
}
@@ -318,7 +318,7 @@ void func_808FA4F4(EnRr* this, PlayState* play) {
Message_StartTextbox(play, 0xF6, NULL);
}
if (this->actor.params == ENRR_0) {
if (this->actor.params == LIKE_LIKE_PARAM_0) {
sp38 = 8;
} else {
sp38 = 16;
@@ -801,7 +801,7 @@ void EnRr_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
if (this->actor.params == ENRR_2) {
if (this->actor.params == LIKE_LIKE_PARAM_2) {
this->actor.speed = 0.0f;
} else {
Math_StepToF(&this->actor.speed, 0.0f, 0.1f);
@@ -878,7 +878,7 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) {
PlayState* play = play2;
EnRr* this = THIS;
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, 4 * sizeof(Mtx));
Vec3f* vecPtr;
Vec3f* bodyPartPos;
s32 i;
EnRrStruct* ptr;
Vec3f spA4;
@@ -897,14 +897,15 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) {
Matrix_Scale((1.0f + this->unk_324[0].unk_10) * this->unk_324[0].unk_08, 1.0f,
(1.0f + this->unk_324[0].unk_10) * this->unk_324[0].unk_08, MTXMODE_APPLY);
vecPtr = &this->limbPos[0];
bodyPartPos = &this->bodyPartsPos[0];
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_MultVecZ(1842.1053f, vecPtr++);
Matrix_MultVecZ(-1842.1053f, vecPtr++);
Matrix_MultVecX(1842.1053f, vecPtr++);
Matrix_MultVecX(-1842.1053f, vecPtr++);
// LIKE_LIKE_BODYPART_0 - LIKE_LIKE_BODYPART_3
Matrix_MultVecZ(1842.1053f, bodyPartPos++);
Matrix_MultVecZ(-1842.1053f, bodyPartPos++);
Matrix_MultVecX(1842.1053f, bodyPartPos++);
Matrix_MultVecX(-1842.1053f, bodyPartPos++);
Matrix_Pop();
for (i = 1; i < ARRAY_COUNT(this->unk_324); i++) {
@@ -921,10 +922,14 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) {
Matrix_RotateYS(0x2000, MTXMODE_APPLY);
}
Matrix_MultVecZ(1842.1053f, vecPtr++);
Matrix_MultVecZ(-1842.1053f, vecPtr++);
Matrix_MultVecX(1842.1053f, vecPtr++);
Matrix_MultVecX(-1842.1053f, vecPtr++);
// LIKE_LIKE_BODYPART_4 - LIKE_LIKE_BODYPART_7
// LIKE_LIKE_BODYPART_8 - LIKE_LIKE_BODYPART_11
// LIKE_LIKE_BODYPART_12 - LIKE_LIKE_BODYPART_15
// LIKE_LIKE_BODYPART_16 - LIKE_LIKE_BODYPART_19
Matrix_MultVecZ(1842.1053f, bodyPartPos++);
Matrix_MultVecZ(-1842.1053f, bodyPartPos++);
Matrix_MultVecX(1842.1053f, bodyPartPos++);
Matrix_MultVecX(-1842.1053f, bodyPartPos++);
Matrix_Pop();
mtx++;
if (i == 3) {
@@ -939,7 +944,7 @@ void EnRr_Draw(Actor* thisx, PlayState* play2) {
gSPDisplayList(POLY_OPA_DISP++, gLikeLikeDL);
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos),
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, LIKE_LIKE_BODYPART_MAX,
this->actor.scale.y * 66.66667f * this->drawDmgEffScale, this->drawDmgEffFrozenSteamScale,
this->drawDmgEffAlpha, this->drawDmgEffType);
+30 -6
View File
@@ -8,11 +8,35 @@ struct EnRr;
typedef void (*EnRrActionFunc)(struct EnRr*, PlayState*);
typedef enum {
/* 0 */ ENRR_0,
/* 1 */ ENRR_1,
/* 2 */ ENRR_2,
/* 3 */ ENRR_3
} EnRrParam;
/* 0 */ LIKE_LIKE_PARAM_0,
/* 1 */ LIKE_LIKE_PARAM_1,
/* 2 */ LIKE_LIKE_PARAM_2,
/* 3 */ LIKE_LIKE_PARAM_3
} LikeLikeParam;
typedef enum LikeLikeBodyPart {
/* 0 */ LIKE_LIKE_BODYPART_0,
/* 1 */ LIKE_LIKE_BODYPART_1,
/* 2 */ LIKE_LIKE_BODYPART_2,
/* 3 */ LIKE_LIKE_BODYPART_3,
/* 4 */ LIKE_LIKE_BODYPART_4,
/* 5 */ LIKE_LIKE_BODYPART_5,
/* 6 */ LIKE_LIKE_BODYPART_6,
/* 7 */ LIKE_LIKE_BODYPART_7,
/* 8 */ LIKE_LIKE_BODYPART_8,
/* 9 */ LIKE_LIKE_BODYPART_9,
/* 10 */ LIKE_LIKE_BODYPART_10,
/* 11 */ LIKE_LIKE_BODYPART_11,
/* 12 */ LIKE_LIKE_BODYPART_12,
/* 13 */ LIKE_LIKE_BODYPART_13,
/* 14 */ LIKE_LIKE_BODYPART_14,
/* 15 */ LIKE_LIKE_BODYPART_15,
/* 16 */ LIKE_LIKE_BODYPART_16,
/* 17 */ LIKE_LIKE_BODYPART_17,
/* 18 */ LIKE_LIKE_BODYPART_18,
/* 19 */ LIKE_LIKE_BODYPART_19,
/* 20 */ LIKE_LIKE_BODYPART_MAX
} LikeLikeBodyPart;
typedef struct {
/* 0x00 */ f32 unk_00;
@@ -58,7 +82,7 @@ typedef struct EnRr {
/* 0x220 */ f32 drawDmgEffScale;
/* 0x224 */ f32 drawDmgEffFrozenSteamScale;
/* 0x228 */ Vec3f unk_228;
/* 0x234 */ Vec3f limbPos[20];
/* 0x234 */ Vec3f bodyPartsPos[LIKE_LIKE_BODYPART_MAX];
/* 0x324 */ EnRrStruct unk_324[5];
} EnRr; // size = 0x3C4
+61 -12
View File
@@ -97,17 +97,66 @@ static AnimationInfoS sAnimationInfo[] = {
{ &gAdultRutoSwimmingUpAnim, 1.0f, 0, -1, ANIMMODE_LOOP, -4 },
};
// in PostLimbdraw, converts limbIndex to bodyPartsPos index
static s8 sBodyPartPosIndices[] = {
-1, -1, 12, 13, 14, -1, 9, 10, 11, -1, 0, 6, -1, -1, 7, 8, 2, -1, -1, 3, 4, 2, 1,
static s8 sLimbToBodyParts[RU2_LIMB_MAX] = {
BODYPART_NONE, // RU2_LIMB_NONE
BODYPART_NONE, // RU2_LIMB_ROOT
RU_BODYPART_12, // RU2_LIMB_LEFT_THIGH
RU_BODYPART_13, // RU2_LIMB_LEFT_LEG
RU_BODYPART_14, // RU2_LIMB_LEFT_FOOT
BODYPART_NONE, // RU2_LIMB_LEFT_TAIL
RU_BODYPART_9, // RU2_LIMB_RIGHT_THIGH
RU_BODYPART_10, // RU2_LIMB_RIGHT_LEG
RU_BODYPART_11, // RU2_LIMB_RIGHT_FOOT
BODYPART_NONE, // RU2_LIMB_RIGHT_TAIL
RU_BODYPART_0, // RU2_LIMB_TORSO
RU_BODYPART_6, // RU2_LIMB_LEFT_UPPER_ARM
BODYPART_NONE, // RU2_LIMB_LEFT_UPPER_WING
BODYPART_NONE, // RU2_LIMB_LEFT_LOWER_WING
RU_BODYPART_7, // RU2_LIMB_LEFT_FOREARM
RU_BODYPART_8, // RU2_LIMB_LEFT_HAND
RU_BODYPART_2, // RU2_LIMB_RIGHT_UPPER_ARM
BODYPART_NONE, // RU2_LIMB_RIGHT_UPPER_WING
BODYPART_NONE, // RU2_LIMB_RIGHT_LOWER_WING
RU_BODYPART_3, // RU2_LIMB_RIGHT_FOREARM
RU_BODYPART_4, // RU2_LIMB_RIGHT_HAND
RU_BODYPART_2, // RU2_LIMB_HEAD
RU_BODYPART_1, // RU2_LIMB_WAIST
};
static s8 sRuBodyParts[RU_BODYPARTSPOS_COUNT] = {
0, 0, 0, 0, 3, 4, 0, 6, 7, 0, 9, 10, 0, 12, 13,
static s8 sParentShadowBodyParts[RU_BODYPART_MAX] = {
RU_BODYPART_0, // RU_BODYPART_0
RU_BODYPART_0, // RU_BODYPART_1
RU_BODYPART_0, // RU_BODYPART_2
RU_BODYPART_0, // RU_BODYPART_3
RU_BODYPART_3, // RU_BODYPART_4
RU_BODYPART_4, // RU_BODYPART_5
RU_BODYPART_0, // RU_BODYPART_6
RU_BODYPART_6, // RU_BODYPART_7
RU_BODYPART_7, // RU_BODYPART_8
RU_BODYPART_0, // RU_BODYPART_9
RU_BODYPART_9, // RU_BODYPART_10
RU_BODYPART_10, // RU_BODYPART_11
RU_BODYPART_0, // RU_BODYPART_12
RU_BODYPART_12, // RU_BODYPART_13
RU_BODYPART_13, // RU_BODYPART_14
};
static u8 sRuShadowSizes[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
static u8 sShadowSizes[RU_BODYPART_MAX] = {
0, // RU_BODYPART_0
0, // RU_BODYPART_1
0, // RU_BODYPART_2
0, // RU_BODYPART_3
0, // RU_BODYPART_4
0, // RU_BODYPART_5
0, // RU_BODYPART_6
0, // RU_BODYPART_7
0, // RU_BODYPART_8
0, // RU_BODYPART_9
0, // RU_BODYPART_10
0, // RU_BODYPART_11
0, // RU_BODYPART_12
0, // RU_BODYPART_13
0, // RU_BODYPART_14
};
static TrackOptionsSet sTrackOptions = {
@@ -202,7 +251,7 @@ void EnRu_UpdateModel(EnRu* this, PlayState* play) {
Vec3f playerPos;
playerPos.x = player->actor.world.pos.x;
playerPos.y = player->bodyPartsPos[7].y + 3.0f;
playerPos.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
playerPos.z = player->actor.world.pos.z;
SubS_TrackPoint(&playerPos, &this->actor.focus.pos, &this->actor.shape.rot, &this->trackTarget, &this->headRot,
&this->torsoRot, &sTrackOptions);
@@ -286,8 +335,8 @@ void EnRu_PostLimbdraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
Vec3f headFocus = { 800.0f, 0, 0 };
Vec3f bodyPartPos = { 0, 0, 0 };
if (sBodyPartPosIndices[limbIndex] >= 0) {
Matrix_MultVec3f(&bodyPartPos, &this->bodyPartsPos[sBodyPartPosIndices[limbIndex]]);
if (sLimbToBodyParts[limbIndex] > BODYPART_NONE) {
Matrix_MultVec3f(&bodyPartPos, &this->bodyPartsPos[sLimbToBodyParts[limbIndex]]);
}
if (limbIndex == RU2_LIMB_HEAD) {
Matrix_MultVec3f(&headFocus, &thisx->focus.pos);
@@ -344,8 +393,8 @@ void EnRu_Draw(Actor* thisx, PlayState* play) {
}
for (i = 0; i < 5; i++) {
SubS_GenShadowTex(&this->bodyPartsPos[0], &this->actor.world.pos, shadowTex, (i / 5.0f),
(ARRAY_COUNT(sRuBodyParts)), sRuShadowSizes, sRuBodyParts);
SubS_GenShadowTex(this->bodyPartsPos, &this->actor.world.pos, shadowTex, i / 5.0f, RU_BODYPART_MAX,
sShadowSizes, sParentShadowBodyParts);
}
SubS_DrawShadowTex(&this->actor, &play->state, shadowTex);
+19 -2
View File
@@ -12,7 +12,24 @@ struct EnRu;
typedef void (*EnRuActionFunc)(struct EnRu*, PlayState*);
#define RU_BODYPARTSPOS_COUNT 15
typedef enum EnRuBodyPart {
/* 0 */ RU_BODYPART_0,
/* 1 */ RU_BODYPART_1,
/* 2 */ RU_BODYPART_2,
/* 3 */ RU_BODYPART_3,
/* 4 */ RU_BODYPART_4,
/* 5 */ RU_BODYPART_5,
/* 6 */ RU_BODYPART_6,
/* 7 */ RU_BODYPART_7,
/* 8 */ RU_BODYPART_8,
/* 9 */ RU_BODYPART_9,
/* 10 */ RU_BODYPART_10,
/* 11 */ RU_BODYPART_11,
/* 12 */ RU_BODYPART_12,
/* 13 */ RU_BODYPART_13,
/* 14 */ RU_BODYPART_14,
/* 15 */ RU_BODYPART_MAX
} EnruBodyPart;
typedef struct EnRu {
/* 0x000 */ Actor actor;
@@ -34,7 +51,7 @@ typedef struct EnRu {
/* 0x324 */ UNK_TYPE1 pad324[0x12];
/* 0x336 */ s16 fidgetTableY[RU2_LIMB_MAX];
/* 0x364 */ s16 fidgetTableZ[RU2_LIMB_MAX];
/* 0x394 */ Vec3f bodyPartsPos[RU_BODYPARTSPOS_COUNT];
/* 0x394 */ Vec3f bodyPartsPos[RU_BODYPART_MAX];
/* 0x348 */ UNK_TYPE1 padUNK[6];
/* 0x44E */ s16 eyeState;
/* 0x450 */ s16 blinkTimer;
@@ -222,7 +222,7 @@ void EnRuppecrow_ShatterIce(EnRuppecrow* this, PlayState* play) {
if (this->currentEffect == ENRUPPECROW_EFFECT_ICE) {
this->currentEffect = ENRUPPECROW_EFFECT_NONE;
this->unk_2C8 = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 0x2, 0.2f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, ENRUPPECROW_BODYPART_MAX, 0x2, 0.2f, 0.2f);
}
}
@@ -640,7 +640,7 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2) {
EnRuppecrow* this = THIS;
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->joinTable, this->morphTable,
SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->jointTable, this->morphTable,
OBJECT_CROW_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f);
@@ -9,19 +9,26 @@
#define ENRUPPECROW_PATH_INDEX_NONE 0x3F
#define ENRUPPECROW_RUPEE_COUNT 20
#define ENRUPPECROW_LIMB_POS_COUNT 4
struct EnRuppecrow;
typedef void (*EnRuppecrowActionFunc)(struct EnRuppecrow*, PlayState*);
typedef enum EnRuppecrowBodyPart {
/* 0 */ ENRUPPECROW_BODYPART_0,
/* 1 */ ENRUPPECROW_BODYPART_1,
/* 2 */ ENRUPPECROW_BODYPART_2,
/* 3 */ ENRUPPECROW_BODYPART_3,
/* 4 */ ENRUPPECROW_BODYPART_MAX
} EnRuppecrowBodyPart;
typedef struct EnRuppecrow {
/* 0x000 */ Actor actor;
/* 0x144 */ EnItem00* rupees[ENRUPPECROW_RUPEE_COUNT];
/* 0x194 */ SkelAnime skelAnime;
/* 0x1D8 */ EnRuppecrowActionFunc actionFunc;
/* 0x1DC */ UNK_TYPE4 unk_1DC; // unused
/* 0x1E0 */ Vec3s joinTable[OBJECT_CROW_LIMB_MAX];
/* 0x1E0 */ Vec3s jointTable[OBJECT_CROW_LIMB_MAX];
/* 0x216 */ Vec3s morphTable[OBJECT_CROW_LIMB_MAX];
/* 0x24C */ Path* path;
/* 0x250 */ s32 currentPoint;
@@ -36,7 +43,7 @@ typedef struct EnRuppecrow {
/* 0x2C8 */ f32 unk_2C8; // set but not used
/* 0x2CC */ f32 unk_2CC; // set but not used
/* 0x2D0 */ f32 iceSfxTimer;
/* 0x2D4 */ Vec3f limbPos[ENRUPPECROW_LIMB_POS_COUNT];
/* 0x2D4 */ Vec3f bodyPartsPos[ENRUPPECROW_BODYPART_MAX];
} EnRuppecrow; // size = 0x304
#endif // Z_EN_RUPPECROW_H
+1 -1
View File
@@ -127,7 +127,7 @@ void func_80AE626C(EnShn* this) {
this->unk_2BC = CLAMP(this->unk_2BC, -0x1FFE, 0x1FFE);
Math_Vec3f_Copy(&shnPos, &this->actor.focus.pos);
if (this->shnPlayerRef->actor.id == ACTOR_PLAYER) {
playerPos.y = this->shnPlayerRef->bodyPartsPos[7].y + 3.0f;
playerPos.y = this->shnPlayerRef->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
} else {
Math_Vec3f_Copy(&playerPos, &this->shnPlayerRef->actor.focus.pos);
}
+13 -13
View File
@@ -1008,22 +1008,22 @@ void func_80996BEC(EnSkb* this, PlayState* play) {
Vec3f sp84;
s32 i;
s16 yaw;
s32 end;
s32 bodyPartsCount;
if (this->unk_3D8 & 2) {
end = 13;
bodyPartsCount = ENSKB_BODYPART_MAX - 1;
} else {
end = 14;
bodyPartsCount = ENSKB_BODYPART_MAX;
}
SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 30, NA_SE_EV_ICE_BROKEN);
for (i = 0; i < end; i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->limbPos[i]);
for (i = 0; i < bodyPartsCount; i++) {
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &this->bodyPartsPos[i]);
sp84.x = Math_SinS(yaw) * 3.0f;
sp84.z = Math_CosS(yaw) * 3.0f;
sp84.y = (Rand_ZeroOne() * 4.0f) + 4.0f;
EffectSsEnIce_Spawn(play, &this->limbPos[i], 0.6f, &sp84, &D_80997558, &D_80997550, &D_80997554, 30);
EffectSsEnIce_Spawn(play, &this->bodyPartsPos[i], 0.6f, &sp84, &D_80997558, &D_80997550, &D_80997554, 30);
}
}
@@ -1118,11 +1118,11 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
if ((limbIndex == 2) || (limbIndex == 4) || (limbIndex == 5) || (limbIndex == 6) || (limbIndex == 7) ||
(limbIndex == 8) || (limbIndex == 9) || (limbIndex == 13) || (limbIndex == 14) || (limbIndex == 15) ||
(limbIndex == 16) || (limbIndex == 17) || (limbIndex == 18)) {
Matrix_MultZero(&this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultZero(&this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
} else if ((limbIndex == 11) && !(this->unk_3D8 & 2)) {
Matrix_MultVec3f(&D_80997564, &this->limbPos[this->limbCount]);
this->limbCount++;
Matrix_MultVec3f(&D_80997564, &this->bodyPartsPos[this->bodyPartsCount]);
this->bodyPartsCount++;
}
}
}
@@ -1130,13 +1130,13 @@ void EnSkb_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
void EnSkb_Draw(Actor* thisx, PlayState* play) {
EnSkb* this = THIS;
this->limbCount = 0;
this->bodyPartsCount = 0;
Gfx_SetupDL25_Opa(play->state.gfxCtx);
SkelAnime_DrawOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, EnSkb_OverrideLimbDraw,
EnSkb_PostLimbDraw, &this->actor);
if (this->drawDmgEffTimer > 0) {
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, this->limbCount, this->drawDmgEffScale, 0.5f,
this->drawDmgEffAlpha, this->drawDmgEffType);
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, this->bodyPartsCount, this->drawDmgEffScale,
0.5f, this->drawDmgEffAlpha, this->drawDmgEffType);
}
if (this->unk_3D8 & 0x40) {
+20 -2
View File
@@ -13,6 +13,24 @@ typedef enum {
/* 0 */ ENSKB_PARAM_0
} EnSkbParam;
typedef enum EnSkbBodyPart {
/* 0 */ ENSKB_BODYPART_0,
/* 1 */ ENSKB_BODYPART_1,
/* 2 */ ENSKB_BODYPART_2,
/* 3 */ ENSKB_BODYPART_3,
/* 4 */ ENSKB_BODYPART_4,
/* 5 */ ENSKB_BODYPART_5,
/* 6 */ ENSKB_BODYPART_6,
/* 7 */ ENSKB_BODYPART_7,
/* 8 */ ENSKB_BODYPART_8,
/* 9 */ ENSKB_BODYPART_9,
/* 10 */ ENSKB_BODYPART_10,
/* 11 */ ENSKB_BODYPART_11,
/* 12 */ ENSKB_BODYPART_12,
/* 13 */ ENSKB_BODYPART_13,
/* 14 */ ENSKB_BODYPART_MAX
} EnSkbBodyPart;
typedef struct EnSkb {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
@@ -21,8 +39,8 @@ typedef struct EnSkb {
/* 0x228 */ EnSkbActionFunc actionFunc;
/* 0x22C */ f32 drawDmgEffAlpha;
/* 0x230 */ f32 drawDmgEffScale;
/* 0x234 */ Vec3f limbPos[14];
/* 0x2DC */ s32 limbCount;
/* 0x234 */ Vec3f bodyPartsPos[ENSKB_BODYPART_MAX];
/* 0x2DC */ s32 bodyPartsCount;
/* 0x2E0 */ Vec3s jointTable[20];
/* 0x358 */ Vec3s morphTable[20];
/* 0x3D0 */ s16 unk_3D0;
+18 -15
View File
@@ -154,22 +154,25 @@ static Color_RGBA8 sBubbleEnvColor = { 150, 150, 150, 0 };
static Vec3f sBubbleAccel = { 0.0f, -0.8f, 0.0f };
static Color_RGBA8 sPrimColors[] = {
{ 255, 255, 255, 255 },
{ 255, 255, 0, 255 },
{ 255, 255, 200, 255 },
{ 225, 200, 255, 255 },
{ 255, 255, 255, 255 }, // EN_SLIME_TYPE_BLUE
{ 255, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN
{ 255, 255, 200, 255 }, // EN_SLIME_TYPE_YELLOW
{ 225, 200, 255, 255 }, // EN_SLIME_TYPE_RED
};
static Color_RGBA8 sEnvColors[] = {
{ 140, 255, 195, 255 },
{ 50, 255, 0, 255 },
{ 255, 180, 0, 255 },
{ 255, 50, 155, 255 },
{ 140, 255, 195, 255 }, // EN_SLIME_TYPE_BLUE
{ 50, 255, 0, 255 }, // EN_SLIME_TYPE_GREEN
{ 255, 180, 0, 255 }, // EN_SLIME_TYPE_YELLOW
{ 255, 50, 155, 255 }, // EN_SLIME_TYPE_RED
};
static Vec3f sLimbPosOffsets[EN_SLIME_LIMBPOS_COUNT] = {
{ 2000.0f, 2000.0f, 0.0f }, { -1500.0f, 2500.0f, -500.0f }, { -500.0f, 1000.0f, 2500.0f },
{ 0.0f, 4000.0f, 0.0f }, { 0.0f, 2000.0f, -2000.0f },
static Vec3f sBodyPartPosOffsets[EN_SLIME_BODYPART_MAX] = {
{ 2000.0f, 2000.0f, 0.0f }, // EN_SLIME_BODYPART_0
{ -1500.0f, 2500.0f, -500.0f }, // EN_SLIME_BODYPART_1
{ -500.0f, 1000.0f, 2500.0f }, // EN_SLIME_BODYPART_2
{ 0.0f, 4000.0f, 0.0f }, // EN_SLIME_BODYPART_3
{ 0.0f, 2000.0f, -2000.0f }, // EN_SLIME_BODYPART_4
};
AnimatedMaterial* sSlimeTexAnim;
@@ -263,7 +266,7 @@ void EnSlime_Thaw(EnSlime* this, PlayState* play) {
this->drawDmgEffType = 0; // So it's not triggered again until Freeze has been called again.
this->collider.base.colType = COLTYPE_NONE;
this->drawDmgEffAlpha = 0.0f;
Actor_SpawnIceEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), 2, 0.2f, 0.2f);
Actor_SpawnIceEffects(play, &this->actor, this->bodyPartsPos, EN_SLIME_BODYPART_MAX, 2, 0.2f, 0.2f);
this->actor.flags |= ACTOR_FLAG_200;
}
}
@@ -1217,8 +1220,8 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, gChuchuEyesDL);
}
for (i = 0; i < EN_SLIME_LIMBPOS_COUNT; i++) {
Matrix_MultVec3f(&sLimbPosOffsets[i], &this->limbPos[i]);
for (i = 0; i < EN_SLIME_BODYPART_MAX; i++) {
Matrix_MultVec3f(&sBodyPartPosOffsets[i], &this->bodyPartsPos[i]);
}
if (this->actionFunc == EnSlime_Revive) {
@@ -1243,7 +1246,7 @@ void EnSlime_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_OPA_DISP++, gItemDropDL);
}
Actor_DrawDamageEffects(play, &this->actor, this->limbPos, ARRAY_COUNT(this->limbPos), this->drawDmgEffScale,
Actor_DrawDamageEffects(play, &this->actor, this->bodyPartsPos, EN_SLIME_BODYPART_MAX, this->drawDmgEffScale,
this->drawDmgEffFrozenSteamScale, this->drawDmgEffAlpha, this->drawDmgEffType);
CLOSE_DISPS(play->state.gfxCtx);

Some files were not shown because too many files have changed in this diff Show More