mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
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:
+2
-2
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user