mirror of
https://github.com/zeldaret/oot.git
synced 2025-05-11 19:43:44 +00:00
Document/fix Player.bodyPartsPos
usage (#1141)
* Document/fix `Player#bodyPartsPos` usage * `distFromLinksHead` -> `distFromPlayerHat` * Comment on `bodyPartsPos[-1]` * Run formatter * Use `PLAYER_BODYPART_MAX` more * Use hex for `PlayerBodyPart` enum comments
This commit is contained in:
parent
c73053db6f
commit
5cadc5df8a
18 changed files with 166 additions and 120 deletions
|
@ -150,6 +150,28 @@ typedef enum {
|
|||
/* 0x16 */ PLAYER_LIMB_MAX
|
||||
} PlayerLimb;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ PLAYER_BODYPART_WAIST, // PLAYER_LIMB_WAIST
|
||||
/* 0x01 */ PLAYER_BODYPART_R_THIGH, // PLAYER_LIMB_R_THIGH
|
||||
/* 0x02 */ PLAYER_BODYPART_R_SHIN, // PLAYER_LIMB_R_SHIN
|
||||
/* 0x03 */ PLAYER_BODYPART_R_FOOT, // PLAYER_LIMB_R_FOOT
|
||||
/* 0x04 */ PLAYER_BODYPART_L_THIGH, // PLAYER_LIMB_L_THIGH
|
||||
/* 0x05 */ PLAYER_BODYPART_L_SHIN, // PLAYER_LIMB_L_SHIN
|
||||
/* 0x06 */ PLAYER_BODYPART_L_FOOT, // PLAYER_LIMB_L_FOOT
|
||||
/* 0x07 */ PLAYER_BODYPART_HEAD, // PLAYER_LIMB_HEAD
|
||||
/* 0x08 */ PLAYER_BODYPART_HAT, // PLAYER_LIMB_HAT
|
||||
/* 0x09 */ PLAYER_BODYPART_COLLAR, // PLAYER_LIMB_COLLAR
|
||||
/* 0x0A */ PLAYER_BODYPART_L_SHOULDER, // PLAYER_LIMB_L_SHOULDER
|
||||
/* 0x0B */ PLAYER_BODYPART_L_FOREARM, // PLAYER_LIMB_L_FOREARM
|
||||
/* 0x0C */ PLAYER_BODYPART_L_HAND, // PLAYER_LIMB_L_HAND
|
||||
/* 0x0D */ PLAYER_BODYPART_R_SHOULDER, // PLAYER_LIMB_R_SHOULDER
|
||||
/* 0x0E */ PLAYER_BODYPART_R_FOREARM, // PLAYER_LIMB_R_FOREARM
|
||||
/* 0x0F */ PLAYER_BODYPART_R_HAND, // PLAYER_LIMB_R_HAND
|
||||
/* 0x10 */ PLAYER_BODYPART_SHEATH, // PLAYER_LIMB_SHEATH
|
||||
/* 0x11 */ PLAYER_BODYPART_TORSO, // PLAYER_LIMB_TORSO
|
||||
/* 0x12 */ PLAYER_BODYPART_MAX
|
||||
} PlayerBodyPart;
|
||||
|
||||
typedef enum {
|
||||
/* -1 */ PLAYER_DOORTYPE_AJAR = -1,
|
||||
/* 0 */ PLAYER_DOORTYPE_NONE,
|
||||
|
@ -440,11 +462,11 @@ typedef struct Player {
|
|||
/* 0x08AC */ f32 windSpeed;
|
||||
/* 0x08B0 */ s16 windDirection;
|
||||
/* 0x08B4 */ WeaponInfo meleeWeaponInfo[3];
|
||||
/* 0x0908 */ Vec3f bodyPartsPos[18];
|
||||
/* 0x0908 */ Vec3f bodyPartsPos[PLAYER_BODYPART_MAX];
|
||||
/* 0x09E0 */ MtxF mf_9E0;
|
||||
/* 0x0A20 */ MtxF shieldMf;
|
||||
/* 0x0A60 */ u8 isBurning;
|
||||
/* 0x0A61 */ u8 flameTimers[18]; // one flame per body part
|
||||
/* 0x0A61 */ u8 flameTimers[PLAYER_BODYPART_MAX]; // one flame per body part
|
||||
/* 0x0A73 */ u8 unk_A73;
|
||||
/* 0x0A74 */ PlayerFuncA74 func_A74;
|
||||
/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame)
|
||||
|
|
|
@ -4482,7 +4482,7 @@ s32 Camera_Unique1(Camera* camera) {
|
|||
Vec3f* eye = &camera->eye;
|
||||
Vec3f* at = &camera->at;
|
||||
Vec3f* eyeNext = &camera->eyeNext;
|
||||
Vec3f playerBodyPart0;
|
||||
Vec3f playerWaistPos;
|
||||
s16 phiTarget;
|
||||
VecSph sp8C;
|
||||
VecSph unk908PlayerPosOffset;
|
||||
|
@ -4524,8 +4524,8 @@ s32 Camera_Unique1(Camera* camera) {
|
|||
camera->posOffset.y = camera->posOffset.y - camera->playerPosDelta.y;
|
||||
anim->yawTarget = eyeNextAtOffset.yaw;
|
||||
anim->unk_00 = 0.0f;
|
||||
playerBodyPart0 = camera->player->bodyPartsPos[0];
|
||||
OLib_Vec3fDiffToVecSphGeo(&unk908PlayerPosOffset, &playerPosRot->pos, &playerBodyPart0);
|
||||
playerWaistPos = camera->player->bodyPartsPos[PLAYER_BODYPART_WAIST];
|
||||
OLib_Vec3fDiffToVecSphGeo(&unk908PlayerPosOffset, &playerPosRot->pos, &playerWaistPos);
|
||||
anim->timer = R_DEFA_CAM_ANIM_TIME;
|
||||
anim->yawTargetAdj = ABS(BINANG_SUB(unk908PlayerPosOffset.yaw, eyeAtOffset.yaw)) < 0x3A98
|
||||
? 0
|
||||
|
|
|
@ -274,7 +274,7 @@ Gfx gCullFrontDList[] = {
|
|||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Vec3f* D_80160000;
|
||||
Vec3f* sCurBodyPartPos;
|
||||
s32 sDListsLodOffset;
|
||||
Vec3f sGetItemRefPos;
|
||||
s32 D_80160014;
|
||||
|
@ -768,7 +768,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable,
|
|||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 1803);
|
||||
}
|
||||
|
||||
Vec3f D_8012602C = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
Vec3f D_80126038[] = {
|
||||
{ 1304.0f, 0.0f, 0.0f },
|
||||
|
@ -816,10 +816,10 @@ void func_8008F87C(GlobalContext* globalCtx, Player* this, SkelAnime* skelAnime,
|
|||
|
||||
Matrix_Push();
|
||||
Matrix_TranslateRotateZYX(pos, rot);
|
||||
Matrix_MultVec3f(&D_8012602C, &spA4);
|
||||
Matrix_MultVec3f(&sZeroVec, &spA4);
|
||||
Matrix_TranslateRotateZYX(&D_80126038[(void)0, gSaveContext.linkAge], &skelAnime->jointTable[shinLimbIndex]);
|
||||
Matrix_Translate(D_80126050[(void)0, gSaveContext.linkAge], 0.0f, 0.0f, MTXMODE_APPLY);
|
||||
Matrix_MultVec3f(&D_8012602C, &sp98);
|
||||
Matrix_MultVec3f(&sZeroVec, &sp98);
|
||||
Matrix_MultVec3f(&D_80126070, &footprintPos);
|
||||
Matrix_Pop();
|
||||
|
||||
|
@ -881,7 +881,13 @@ s32 func_8008FCC8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
|
|||
if (limbIndex == PLAYER_LIMB_ROOT) {
|
||||
D_80160014 = this->leftHandType;
|
||||
D_80160018 = this->rightHandType;
|
||||
D_80160000 = &this->meleeWeaponInfo[2].base;
|
||||
|
||||
// `sCurBodyPartPos` is incremented before each usage, so it starts at index -1.
|
||||
// What determines if a limb corresponds to a body part is whether or not it has a non-NULL `dList`.
|
||||
// Note: The increment would not be done for the root limb, even if it had a non-NULL `dList`.
|
||||
// So if the root limb had a non-NULL `dList` (which is not the case in vanilla),
|
||||
// an out-of-bounds write to `bodyPartsPos` would occur.
|
||||
sCurBodyPartPos = &this->bodyPartsPos[-1];
|
||||
|
||||
if (!LINK_IS_ADULT) {
|
||||
if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) {
|
||||
|
@ -905,7 +911,7 @@ s32 func_8008FCC8(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* p
|
|||
}
|
||||
} else {
|
||||
if (*dList != NULL) {
|
||||
D_80160000++;
|
||||
sCurBodyPartPos++;
|
||||
}
|
||||
|
||||
if (limbIndex == PLAYER_LIMB_HEAD) {
|
||||
|
@ -1243,14 +1249,14 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
|||
Player* this = (Player*)thisx;
|
||||
|
||||
if (*dList != NULL) {
|
||||
Matrix_MultVec3f(&D_8012602C, D_80160000);
|
||||
Matrix_MultVec3f(&sZeroVec, sCurBodyPartPos);
|
||||
}
|
||||
|
||||
if (limbIndex == PLAYER_LIMB_L_HAND) {
|
||||
MtxF sp14C;
|
||||
Actor* hookedActor;
|
||||
|
||||
Math_Vec3f_Copy(&this->leftHandPos, D_80160000);
|
||||
Math_Vec3f_Copy(&this->leftHandPos, sCurBodyPartPos);
|
||||
|
||||
if (this->itemActionParam == PLAYER_AP_STICK) {
|
||||
Vec3f sp124[3];
|
||||
|
@ -1342,8 +1348,8 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
|||
Vec3f sp90;
|
||||
f32 distXYZ;
|
||||
|
||||
Matrix_MultVec3f(&D_8012602C, &sp90);
|
||||
distXYZ = Math_Vec3f_DistXYZ(D_80160000, &sp90);
|
||||
Matrix_MultVec3f(&sZeroVec, &sp90);
|
||||
distXYZ = Math_Vec3f_DistXYZ(sCurBodyPartPos, &sp90);
|
||||
|
||||
this->unk_858 = distXYZ - 3.0f;
|
||||
if (distXYZ < 3.0f) {
|
||||
|
@ -1404,9 +1410,9 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
|
|||
(this->exchangeItemId != EXCH_ITEM_NONE)) {
|
||||
Math_Vec3f_Copy(&sGetItemRefPos, &this->leftHandPos);
|
||||
} else {
|
||||
sGetItemRefPos.x = (this->bodyPartsPos[15].x + this->leftHandPos.x) * 0.5f;
|
||||
sGetItemRefPos.y = (this->bodyPartsPos[15].y + this->leftHandPos.y) * 0.5f;
|
||||
sGetItemRefPos.z = (this->bodyPartsPos[15].z + this->leftHandPos.z) * 0.5f;
|
||||
sGetItemRefPos.x = (this->bodyPartsPos[PLAYER_BODYPART_R_HAND].x + this->leftHandPos.x) * 0.5f;
|
||||
sGetItemRefPos.y = (this->bodyPartsPos[PLAYER_BODYPART_R_HAND].y + this->leftHandPos.y) * 0.5f;
|
||||
sGetItemRefPos.z = (this->bodyPartsPos[PLAYER_BODYPART_R_HAND].z + this->leftHandPos.z) * 0.5f;
|
||||
}
|
||||
|
||||
if (this->unk_862 == 0) {
|
||||
|
|
|
@ -1476,7 +1476,7 @@ void BossFd_UpdateEffects(BossFd* this, GlobalContext* globalCtx) {
|
|||
this->timers[3] = 50;
|
||||
func_8002F6D4(globalCtx, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
|
||||
if (player->isBurning == false) {
|
||||
for (i2 = 0; i2 < ARRAY_COUNT(player->flameTimers); i2++) {
|
||||
for (i2 = 0; i2 < PLAYER_BODYPART_MAX; i2++) {
|
||||
player->flameTimers[i2] = Rand_S16Offset(0, 200);
|
||||
}
|
||||
player->isBurning = true;
|
||||
|
|
|
@ -3354,7 +3354,7 @@ void BossGanon_DrawShock(BossGanon* this, GlobalContext* globalCtx) {
|
|||
if (this->unk_2E8 != 0) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(player->bodyPartsPos); i++) {
|
||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++) {
|
||||
Matrix_Translate(player->bodyPartsPos[i].x, player->bodyPartsPos[i].y, player->bodyPartsPos[i].z,
|
||||
MTXMODE_NEW);
|
||||
Matrix_ReplaceRotation(&globalCtx->billboardMtxF);
|
||||
|
@ -3535,7 +3535,7 @@ void BossGanon_DrawTriforce(BossGanon* this, GlobalContext* globalCtx) {
|
|||
if (this->triforceType == GDF_TRIFORCE_PLAYER) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
this->triforcePos = player->bodyPartsPos[12];
|
||||
this->triforcePos = player->bodyPartsPos[PLAYER_BODYPART_L_HAND];
|
||||
|
||||
this->triforcePos.x += -0.6f;
|
||||
this->triforcePos.y += 3.0f;
|
||||
|
@ -4691,7 +4691,7 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) {
|
|||
eff->pos.y = sGanondorf->unk_2EC[bodyPart].y + Rand_CenteredFloat(20.0f);
|
||||
eff->pos.z = sGanondorf->unk_2EC[bodyPart].z + Rand_CenteredFloat(20.0f);
|
||||
} else {
|
||||
bodyPart = (s16)Rand_ZeroFloat(17.9f);
|
||||
bodyPart = (s16)Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
|
||||
eff->pos.x = player->bodyPartsPos[bodyPart].x + Rand_CenteredFloat(10.0f);
|
||||
eff->pos.y = player->bodyPartsPos[bodyPart].y + Rand_CenteredFloat(15.0f);
|
||||
|
|
|
@ -1853,7 +1853,7 @@ void func_80902348(BossGanon2* this, GlobalContext* globalCtx) {
|
|||
temp_f12 = -200.0f - player->actor.world.pos.z;
|
||||
|
||||
if (sqrtf(SQ(temp_f2) + SQ(temp_f12)) > 784.0f) {
|
||||
for (j = 0; j < ARRAY_COUNT(player->flameTimers); j++) {
|
||||
for (j = 0; j < PLAYER_BODYPART_MAX; j++) {
|
||||
player->flameTimers[j] = Rand_S16Offset(0, 200);
|
||||
}
|
||||
|
||||
|
|
|
@ -389,7 +389,7 @@ void BossTw_AddShieldDeflectEffect(GlobalContext* globalCtx, f32 arg1, s16 arg2)
|
|||
BossTwEffect* eff;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
sShieldHitPos = player->bodyPartsPos[15];
|
||||
sShieldHitPos = player->bodyPartsPos[PLAYER_BODYPART_R_HAND];
|
||||
sShieldHitYaw = player->actor.shape.rot.y;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
|
@ -419,7 +419,7 @@ void BossTw_AddShieldHitEffect(GlobalContext* globalCtx, f32 arg1, s16 arg2) {
|
|||
BossTwEffect* eff;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
|
||||
sShieldHitPos = player->bodyPartsPos[15];
|
||||
sShieldHitPos = player->bodyPartsPos[PLAYER_BODYPART_R_HAND];
|
||||
sShieldHitYaw = player->actor.shape.rot.y;
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
|
@ -811,7 +811,7 @@ s32 BossTw_BeamHitPlayerCheck(BossTw* this, GlobalContext* globalCtx) {
|
|||
sFreezeState = 1;
|
||||
}
|
||||
} else if (!player->isBurning) {
|
||||
for (i = 0; i < ARRAY_COUNT(player->flameTimers); i++) {
|
||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++) {
|
||||
player->flameTimers[i] = Rand_S16Offset(0, 200);
|
||||
}
|
||||
|
||||
|
@ -981,9 +981,9 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
if ((player->stateFlags1 & PLAYER_STATE1_22) &&
|
||||
((s16)((player->actor.shape.rot.y - this->actor.shape.rot.y) + 0x8000) < 0x2000) &&
|
||||
((s16)((player->actor.shape.rot.y - this->actor.shape.rot.y) + 0x8000) > -0x2000)) {
|
||||
Math_ApproachF(&this->targetPos.x, player->bodyPartsPos[15].x, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.y, player->bodyPartsPos[15].y, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.z, player->bodyPartsPos[15].z, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.x, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].x, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.y, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].y, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.z, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].z, 1.0f, 400.0f);
|
||||
} else {
|
||||
Math_ApproachF(&this->targetPos.x, player->actor.world.pos.x, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.y, player->actor.world.pos.y + 30.0f, 1.0f, 400.0f);
|
||||
|
@ -1101,7 +1101,7 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
velocity.x = Rand_CenteredFloat(15.0f);
|
||||
velocity.y = Rand_CenteredFloat(15.0f);
|
||||
velocity.z = Rand_CenteredFloat(15.0f);
|
||||
pos = player->bodyPartsPos[15];
|
||||
pos = player->bodyPartsPos[PLAYER_BODYPART_R_HAND];
|
||||
BossTw_AddDotEffect(globalCtx, &pos, &velocity, &accel, (s16)Rand_ZeroFloat(2.0f) + 5,
|
||||
this->actor.params, 150);
|
||||
}
|
||||
|
@ -1146,12 +1146,12 @@ void BossTw_ShootBeam(BossTw* this, GlobalContext* globalCtx) {
|
|||
|
||||
this->beamDist = sqrtf(SQ(xDiff) + SQ(yDiff) + SQ(zDiff));
|
||||
Math_ApproachF(&this->beamReflectionDist, 2000.0f, 1.0f, 40.0f);
|
||||
Math_ApproachF(&this->targetPos.x, player->bodyPartsPos[15].x, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.y, player->bodyPartsPos[15].y, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.z, player->bodyPartsPos[15].z, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.x, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].x, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.y, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].y, 1.0f, 400.0f);
|
||||
Math_ApproachF(&this->targetPos.z, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].z, 1.0f, 400.0f);
|
||||
if ((this->work[CS_TIMER_1] % 4) == 0) {
|
||||
BossTw_AddRingEffect(globalCtx, &player->bodyPartsPos[15], 0.5f, 3.0f, 0xFF, this->actor.params,
|
||||
1, 150);
|
||||
BossTw_AddRingEffect(globalCtx, &player->bodyPartsPos[PLAYER_BODYPART_R_HAND], 0.5f, 3.0f, 0xFF,
|
||||
this->actor.params, 1, 150);
|
||||
}
|
||||
} else {
|
||||
this->beamShootState = 0;
|
||||
|
@ -3948,7 +3948,7 @@ void BossTw_BlastFire(BossTw* this, GlobalContext* globalCtx) {
|
|||
Vec3s blastDir;
|
||||
s16 alpha;
|
||||
|
||||
this->actor.world.pos = player2->bodyPartsPos[15];
|
||||
this->actor.world.pos = player2->bodyPartsPos[PLAYER_BODYPART_R_HAND];
|
||||
this->actor.world.pos.y = -2000.0f;
|
||||
Matrix_MtxFToYXZRotS(&player2->shieldMf, &blastDir, 0);
|
||||
blastDir.x = -blastDir.x;
|
||||
|
@ -3974,8 +3974,8 @@ void BossTw_BlastFire(BossTw* this, GlobalContext* globalCtx) {
|
|||
alpha = this->timers[0] * 10;
|
||||
alpha = CLAMP_MAX(alpha, 255);
|
||||
|
||||
BossTw_AddShieldBlastEffect(globalCtx, &player2->bodyPartsPos[15], &velocity, &sZeroVector,
|
||||
10.0f, 80.0f, alpha, 1);
|
||||
BossTw_AddShieldBlastEffect(globalCtx, &player2->bodyPartsPos[PLAYER_BODYPART_R_HAND],
|
||||
&velocity, &sZeroVector, 10.0f, 80.0f, alpha, 1);
|
||||
}
|
||||
|
||||
if (this->timers[0] == 1) {
|
||||
|
@ -4138,7 +4138,7 @@ void BossTw_BlastIce(BossTw* this, GlobalContext* globalCtx) {
|
|||
Vec3s reflDir;
|
||||
s16 alpha;
|
||||
|
||||
this->actor.world.pos = player2->bodyPartsPos[15];
|
||||
this->actor.world.pos = player2->bodyPartsPos[PLAYER_BODYPART_R_HAND];
|
||||
this->actor.world.pos.y = -2000.0f;
|
||||
Matrix_MtxFToYXZRotS(&player2->shieldMf, &reflDir, 0);
|
||||
reflDir.x = -reflDir.x;
|
||||
|
@ -4164,8 +4164,8 @@ void BossTw_BlastIce(BossTw* this, GlobalContext* globalCtx) {
|
|||
alpha = this->timers[0] * 10;
|
||||
alpha = CLAMP_MAX(alpha, 255);
|
||||
|
||||
BossTw_AddShieldBlastEffect(globalCtx, &player2->bodyPartsPos[15], &velocity, &sZeroVector,
|
||||
10.0f, 80.0f, alpha, 0);
|
||||
BossTw_AddShieldBlastEffect(globalCtx, &player2->bodyPartsPos[PLAYER_BODYPART_R_HAND],
|
||||
&velocity, &sZeroVector, 10.0f, 80.0f, alpha, 0);
|
||||
}
|
||||
|
||||
if (this->timers[0] == 1) {
|
||||
|
@ -4837,7 +4837,7 @@ void BossTw_UpdateEffects(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if ((eff->workf[EFF_DIST] > 0.4f) && ((eff->frame & 7) == 0)) {
|
||||
spA6 = Rand_ZeroFloat(17.9f);
|
||||
spA6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
|
||||
if (eff->target == NULL) {
|
||||
spC0.x = player->bodyPartsPos[spA6].x + Rand_CenteredFloat(5.0f);
|
||||
|
|
|
@ -3340,7 +3340,7 @@ void BossVa_UpdateEffects(GlobalContext* globalCtx) {
|
|||
effect->pos.y = effect->offset.y + refActor->actor.world.pos.y;
|
||||
effect->pos.z = effect->offset.z + refActor->actor.world.pos.z;
|
||||
} else {
|
||||
spB6 = Rand_ZeroFloat(ARRAY_COUNT(player->bodyPartsPos) - 0.1f);
|
||||
spB6 = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
effect->pos.x = player->bodyPartsPos[spB6].x + Rand_CenteredFloat(10.0f);
|
||||
effect->pos.y = player->bodyPartsPos[spB6].y + Rand_CenteredFloat(15.0f);
|
||||
effect->pos.z = player->bodyPartsPos[spB6].z + Rand_CenteredFloat(10.0f);
|
||||
|
@ -3759,7 +3759,7 @@ void BossVa_SpawnSpark(GlobalContext* globalCtx, BossVaEffect* effect, BossVa* t
|
|||
|
||||
case SPARK_LINK:
|
||||
effect->type = VA_SMALL_SPARK;
|
||||
index = Rand_ZeroFloat(ARRAY_COUNT(player->bodyPartsPos) - 0.1f);
|
||||
index = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
effect->pos.x = player->bodyPartsPos[index].x + Rand_CenteredFloat(10.0f);
|
||||
effect->pos.y = player->bodyPartsPos[index].y + Rand_CenteredFloat(15.0f);
|
||||
effect->pos.z = player->bodyPartsPos[index].z + Rand_CenteredFloat(10.0f);
|
||||
|
|
|
@ -396,7 +396,7 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, GlobalContext* g
|
|||
s32 pad[2];
|
||||
s32 i;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Vec3f* headPos = &player->bodyPartsPos[PLAYER_LIMB_HEAD];
|
||||
Vec3f* pos = &player->bodyPartsPos[PLAYER_BODYPART_L_FOREARM];
|
||||
Vec3f velocity = { 0.0f, 0.0f, 0.0f };
|
||||
Vec3f accel = { 0.0f, 0.3f, 0.0f };
|
||||
s32 pad2;
|
||||
|
@ -408,13 +408,13 @@ void DemoDu_CsGoronsRuby_SpawnDustWhenHittingLink(DemoDu* this, GlobalContext* g
|
|||
Vec3f position;
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, 31.0f)) {
|
||||
position.x = dustPosOffsets[i + 5].x + headPos->x;
|
||||
position.y = dustPosOffsets[i + 5].y + headPos->y;
|
||||
position.z = dustPosOffsets[i + 5].z + headPos->z;
|
||||
position.x = dustPosOffsets[i + 5].x + pos->x;
|
||||
position.y = dustPosOffsets[i + 5].y + pos->y;
|
||||
position.z = dustPosOffsets[i + 5].z + pos->z;
|
||||
} else {
|
||||
position.x = dustPosOffsets[i + 0].x + headPos->x;
|
||||
position.y = dustPosOffsets[i + 0].y + headPos->y;
|
||||
position.z = dustPosOffsets[i + 0].z + headPos->z;
|
||||
position.x = dustPosOffsets[i + 0].x + pos->x;
|
||||
position.y = dustPosOffsets[i + 0].y + pos->y;
|
||||
position.z = dustPosOffsets[i + 0].z + pos->z;
|
||||
}
|
||||
|
||||
colorDelta = Rand_ZeroOne() * 20.0f - 10.0f;
|
||||
|
|
|
@ -609,7 +609,7 @@ void func_80A0329C(EnElf* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
func_80A0232C(this, globalCtx);
|
||||
this->unk_28C.y = player->bodyPartsPos[0].y;
|
||||
this->unk_28C.y = player->bodyPartsPos[PLAYER_BODYPART_WAIST].y;
|
||||
func_80A02F2C(this, &this->unk_28C);
|
||||
func_80A03018(this, globalCtx);
|
||||
|
||||
|
@ -758,7 +758,7 @@ void func_80A03814(EnElf* this, GlobalContext* globalCtx) {
|
|||
this->unk_28C.x = Math_CosS(this->unk_2AC) * this->unk_2B8;
|
||||
this->unk_28C.z = Math_SinS(this->unk_2AC) * -this->unk_2B8;
|
||||
this->unk_2AC += this->unk_2B0;
|
||||
func_80A02E30(this, &player->bodyPartsPos[0]);
|
||||
func_80A02E30(this, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]);
|
||||
this->unk_2BC = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x);
|
||||
EnElf_SpawnSparkles(this, globalCtx, 32);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FIATY_HEAL - SFX_FLAG);
|
||||
|
@ -782,7 +782,7 @@ void func_80A03990(EnElf* this, GlobalContext* globalCtx) {
|
|||
this->unk_2B8 = 1.0f;
|
||||
}
|
||||
|
||||
func_80A02E30(this, &player->bodyPartsPos[0]);
|
||||
func_80A02E30(this, &player->bodyPartsPos[PLAYER_BODYPART_WAIST]);
|
||||
Actor_SetScale(&this->actor, (1.0f - (SQ(this->unk_2B4) * SQ(1.0f / 9.0f))) * 0.008f);
|
||||
this->unk_2BC = Math_Atan2S(this->actor.velocity.z, this->actor.velocity.x);
|
||||
EnElf_SpawnSparkles(this, globalCtx, 32);
|
||||
|
@ -837,7 +837,7 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
Actor* arrowPointedActor;
|
||||
f32 xScale;
|
||||
f32 distFromLinksHead;
|
||||
f32 distFromPlayerHat;
|
||||
|
||||
func_80A0461C(this, globalCtx);
|
||||
func_80A03AB0(this, globalCtx);
|
||||
|
@ -882,17 +882,17 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
distFromLinksHead = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos);
|
||||
distFromPlayerHat = Math_Vec3f_DistXYZ(&player->bodyPartsPos[PLAYER_BODYPART_HAT], &this->actor.world.pos);
|
||||
|
||||
switch (this->unk_2A8) {
|
||||
case 7:
|
||||
func_80A02C98(this, &player->bodyPartsPos[8], 1.0f - this->unk_2AE * (1.0f / 30.0f));
|
||||
xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[8], &this->actor.world.pos);
|
||||
func_80A02C98(this, &player->bodyPartsPos[PLAYER_BODYPART_HAT], 1.0f - this->unk_2AE * (1.0f / 30.0f));
|
||||
xScale = Math_Vec3f_DistXYZ(&player->bodyPartsPos[PLAYER_BODYPART_HAT], &this->actor.world.pos);
|
||||
|
||||
if (distFromLinksHead < 7.0f) {
|
||||
if (distFromPlayerHat < 7.0f) {
|
||||
this->unk_2C0 = 0;
|
||||
xScale = 0.0f;
|
||||
} else if (distFromLinksHead < 25.0f) {
|
||||
} else if (distFromPlayerHat < 25.0f) {
|
||||
xScale = (xScale - 5.0f) * 0.05f;
|
||||
xScale = 1.0f - xScale;
|
||||
xScale = (1.0f - SQ(xScale)) * 0.008f;
|
||||
|
@ -902,12 +902,12 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) {
|
|||
EnElf_SpawnSparkles(this, globalCtx, 16);
|
||||
break;
|
||||
case 8:
|
||||
func_80A02C98(this, &player->bodyPartsPos[8], 0.2f);
|
||||
this->actor.world.pos = player->bodyPartsPos[8];
|
||||
func_80A02C98(this, &player->bodyPartsPos[PLAYER_BODYPART_HAT], 0.2f);
|
||||
this->actor.world.pos = player->bodyPartsPos[PLAYER_BODYPART_HAT];
|
||||
func_80A029A8(this, 1);
|
||||
break;
|
||||
case 11:
|
||||
nextPos = player->bodyPartsPos[8];
|
||||
nextPos = player->bodyPartsPos[PLAYER_BODYPART_HAT];
|
||||
nextPos.y += 1500.0f * this->actor.scale.y;
|
||||
func_80A02E30(this, &nextPos);
|
||||
EnElf_SpawnSparkles(this, globalCtx, 16);
|
||||
|
@ -948,14 +948,14 @@ void func_80A03CF8(EnElf* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->fairyFlags & 2) {
|
||||
if (distFromLinksHead < 30.0f) {
|
||||
if (distFromPlayerHat < 30.0f) {
|
||||
this->fairyFlags ^= 2;
|
||||
}
|
||||
|
||||
func_80A03148(this, &nextPos, 0.0f, 20.0f, 0.2f);
|
||||
EnElf_SpawnSparkles(this, globalCtx, 16);
|
||||
} else {
|
||||
if (distFromLinksHead > 100.0f) {
|
||||
if (distFromPlayerHat > 100.0f) {
|
||||
this->fairyFlags |= 2;
|
||||
|
||||
if (this->unk_2C7 == 0) {
|
||||
|
@ -1168,8 +1168,8 @@ void func_80A0461C(EnElf* this, GlobalContext* globalCtx) {
|
|||
func_80A01C38(this, temp);
|
||||
|
||||
if (temp == 11) {
|
||||
this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[8], &this->actor.world.pos);
|
||||
this->unk_2AC = Math_Vec3f_Yaw(&this->actor.world.pos, &player->bodyPartsPos[8]);
|
||||
this->unk_2B8 = Math_Vec3f_DistXZ(&player->bodyPartsPos[PLAYER_BODYPART_HAT], &this->actor.world.pos);
|
||||
this->unk_2AC = Math_Vec3f_Yaw(&this->actor.world.pos, &player->bodyPartsPos[PLAYER_BODYPART_HAT]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1217,9 +1217,11 @@ void func_80A04DE4(EnElf* this, GlobalContext* globalCtx) {
|
|||
naviRefPos = globalCtx->actorCtx.targetCtx.naviRefPos;
|
||||
|
||||
if ((player->unk_664 == NULL) || (&player->actor == player->unk_664) || (&this->actor == player->unk_664)) {
|
||||
naviRefPos.x = player->bodyPartsPos[7].x + (Math_SinS(player->actor.shape.rot.y) * 20.0f);
|
||||
naviRefPos.y = player->bodyPartsPos[7].y + 5.0f;
|
||||
naviRefPos.z = player->bodyPartsPos[7].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f);
|
||||
naviRefPos.x =
|
||||
player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + (Math_SinS(player->actor.shape.rot.y) * 20.0f);
|
||||
naviRefPos.y = player->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 5.0f;
|
||||
naviRefPos.z =
|
||||
player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + (Math_CosS(player->actor.shape.rot.y) * 20.0f);
|
||||
}
|
||||
|
||||
this->actor.focus.pos = naviRefPos;
|
||||
|
|
|
@ -215,7 +215,8 @@ s32 Ge2_DetectPlayerInUpdate(GlobalContext* globalCtx, EnGe2* this, Vec3f* pos,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (BgCheck_AnyLineTest1(&globalCtx->colCtx, pos, &player->bodyPartsPos[7], &posResult, &outPoly, 0)) {
|
||||
if (BgCheck_AnyLineTest1(&globalCtx->colCtx, pos, &player->bodyPartsPos[PLAYER_BODYPART_HEAD], &posResult, &outPoly,
|
||||
0)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
|
|
|
@ -75,7 +75,7 @@ void EnMThunder_Init(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
this->collider.dim.yShift = -20;
|
||||
this->unk_1C4 = 8;
|
||||
this->unk_1B4 = 0.0f;
|
||||
this->actor.world.pos = player->bodyPartsPos[0];
|
||||
this->actor.world.pos = player->bodyPartsPos[PLAYER_BODYPART_WAIST];
|
||||
this->unk_1AC = 0.0f;
|
||||
this->unk_1BC = 0.0f;
|
||||
this->actor.shape.rot.y = player->actor.shape.rot.y + 0x8000;
|
||||
|
@ -152,7 +152,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) {
|
|||
Actor* child = this->actor.child;
|
||||
|
||||
this->unk_1B8 = player->unk_858;
|
||||
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->unk_1CA == 0) {
|
||||
|
@ -282,8 +282,8 @@ void func_80A9F9B4(EnMThunder* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (this->unk_1C4 > 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->unk_1C4--;
|
||||
}
|
||||
|
||||
|
|
|
@ -59,8 +59,8 @@ static u8 D_80AFA15C[] = {
|
|||
2, 2, 2, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 3,
|
||||
};
|
||||
|
||||
static s8 D_80AFA16C[] = {
|
||||
2, 9, 10, 11, 12, 13, 14, 0, 15, -1, 3, 4, 5, 6, 7, 8, -1, 1, 0, 0,
|
||||
static s8 D_80AFA16C[PLAYER_BODYPART_MAX] = {
|
||||
2, 9, 10, 11, 12, 13, 14, 0, 15, -1, 3, 4, 5, 6, 7, 8, -1, 1,
|
||||
};
|
||||
|
||||
static Vec3f D_80AFA180[] = {
|
||||
|
@ -266,7 +266,7 @@ void func_80AF95C4(EnSda* this, u8* shadowTexture, Player* player, GlobalContext
|
|||
}
|
||||
}
|
||||
Matrix_RotateX((BREG(50) + 70) / 100.0f, MTXMODE_NEW);
|
||||
for (i = 0; i < 18; i++) {
|
||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++) {
|
||||
if (D_80AFA16C[i] >= 0) {
|
||||
D_80AFA660[D_80AFA16C[i]] = player->bodyPartsPos[i];
|
||||
}
|
||||
|
|
|
@ -3888,9 +3888,12 @@ void Fishing_UpdateFish(Actor* thisx, GlobalContext* globalCtx2) {
|
|||
sp10C.y = -10.0f;
|
||||
sp10C.z = 5.0f;
|
||||
Matrix_MultVec3f(&sp10C, &sp100);
|
||||
Math_ApproachF(&this->actor.world.pos.x, player->bodyPartsPos[15].x + sp100.x, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.y, player->bodyPartsPos[15].y + sp100.y, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.z, player->bodyPartsPos[15].z + sp100.z, 1.0f, 6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.x, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].x + sp100.x, 1.0f,
|
||||
6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.y, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].y + sp100.y, 1.0f,
|
||||
6.0f);
|
||||
Math_ApproachF(&this->actor.world.pos.z, player->bodyPartsPos[PLAYER_BODYPART_R_HAND].z + sp100.z, 1.0f,
|
||||
6.0f);
|
||||
|
||||
D_80B7E144 = 188.0f;
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ void MagicDark_OrbUpdate(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Actor_SetScale(&this->actor, thisx->scale.x);
|
||||
} else if (this->timer < 55) {
|
||||
Actor_SetScale(&this->actor, thisx->scale.x * 0.9f);
|
||||
Math_SmoothStepToF(&this->orbOffset.y, player->bodyPartsPos[0].y, 0.5f, 3.0f, 1.0f);
|
||||
Math_SmoothStepToF(&this->orbOffset.y, player->bodyPartsPos[PLAYER_BODYPART_WAIST].y, 0.5f, 3.0f, 1.0f);
|
||||
if (this->timer > 48) {
|
||||
MagicDark_DimLighting(globalCtx, (54 - this->timer) * 0.2f);
|
||||
}
|
||||
|
@ -208,13 +208,13 @@ void MagicDark_DiamondDraw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Player* player = GET_PLAYER(globalCtx);
|
||||
f32 heightDiff;
|
||||
|
||||
this->actor.world.pos.x = player->bodyPartsPos[0].x;
|
||||
this->actor.world.pos.z = player->bodyPartsPos[0].z;
|
||||
heightDiff = player->bodyPartsPos[0].y - this->actor.world.pos.y;
|
||||
this->actor.world.pos.x = player->bodyPartsPos[PLAYER_BODYPART_WAIST].x;
|
||||
this->actor.world.pos.z = player->bodyPartsPos[PLAYER_BODYPART_WAIST].z;
|
||||
heightDiff = player->bodyPartsPos[PLAYER_BODYPART_WAIST].y - this->actor.world.pos.y;
|
||||
if (heightDiff < -2.0f) {
|
||||
this->actor.world.pos.y = player->bodyPartsPos[0].y + 2.0f;
|
||||
this->actor.world.pos.y = player->bodyPartsPos[PLAYER_BODYPART_WAIST].y + 2.0f;
|
||||
} else if (heightDiff > 2.0f) {
|
||||
this->actor.world.pos.y = player->bodyPartsPos[0].y - 2.0f;
|
||||
this->actor.world.pos.y = player->bodyPartsPos[PLAYER_BODYPART_WAIST].y - 2.0f;
|
||||
}
|
||||
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
|
||||
Matrix_Scale(this->actor.scale.x, this->actor.scale.y, this->actor.scale.z, MTXMODE_APPLY);
|
||||
|
@ -241,9 +241,12 @@ void MagicDark_OrbDraw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
f32 sp6C = globalCtx->state.frames & 0x1F;
|
||||
|
||||
if (this->timer < 32) {
|
||||
pos.x = (player->bodyPartsPos[12].x + player->bodyPartsPos[15].x) * 0.5f;
|
||||
pos.y = (player->bodyPartsPos[12].y + player->bodyPartsPos[15].y) * 0.5f;
|
||||
pos.z = (player->bodyPartsPos[12].z + player->bodyPartsPos[15].z) * 0.5f;
|
||||
pos.x =
|
||||
(player->bodyPartsPos[PLAYER_BODYPART_L_HAND].x + player->bodyPartsPos[PLAYER_BODYPART_R_HAND].x) * 0.5f;
|
||||
pos.y =
|
||||
(player->bodyPartsPos[PLAYER_BODYPART_L_HAND].y + player->bodyPartsPos[PLAYER_BODYPART_R_HAND].y) * 0.5f;
|
||||
pos.z =
|
||||
(player->bodyPartsPos[PLAYER_BODYPART_L_HAND].z + player->bodyPartsPos[PLAYER_BODYPART_R_HAND].z) * 0.5f;
|
||||
if (this->timer > 20) {
|
||||
pos.y += (this->timer - 20) * 1.4f;
|
||||
}
|
||||
|
|
|
@ -180,9 +180,10 @@ void ShotSun_UpdateHyliaSun(ShotSun* this, GlobalContext* globalCtx) {
|
|||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (!(this->actor.xzDistToPlayer > 120.0f) && gSaveContext.dayTime >= 0x4555 && gSaveContext.dayTime < 0x5000) {
|
||||
cylinderPos.x = player->bodyPartsPos[7].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
|
||||
cylinderPos.y = player->bodyPartsPos[7].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
|
||||
cylinderPos.z = player->bodyPartsPos[7].z + globalCtx->envCtx.sunPos.z * (1.0f / 6.0f);
|
||||
cylinderPos.x = player->bodyPartsPos[PLAYER_BODYPART_HEAD].x + globalCtx->envCtx.sunPos.x * (1.0f / 6.0f);
|
||||
cylinderPos.y =
|
||||
player->bodyPartsPos[PLAYER_BODYPART_HEAD].y - 30.0f + globalCtx->envCtx.sunPos.y * (1.0f / 6.0f);
|
||||
cylinderPos.z = player->bodyPartsPos[PLAYER_BODYPART_HEAD].z + globalCtx->envCtx.sunPos.z * (1.0f / 6.0f);
|
||||
|
||||
this->hitboxPos = cylinderPos;
|
||||
|
||||
|
|
|
@ -3210,8 +3210,9 @@ void func_80837530(GlobalContext* globalCtx, Player* this, s32 arg2) {
|
|||
this->stateFlags1 |= PLAYER_STATE1_12;
|
||||
|
||||
if (this->actor.category == ACTORCAT_PLAYER) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_THUNDER, this->bodyPartsPos[0].x,
|
||||
this->bodyPartsPos[0].y, this->bodyPartsPos[0].z, 0, 0, 0, Player_GetMeleeWeaponHeld(this) | arg2);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_THUNDER, this->bodyPartsPos[PLAYER_BODYPART_WAIST].x,
|
||||
this->bodyPartsPos[PLAYER_BODYPART_WAIST].y, this->bodyPartsPos[PLAYER_BODYPART_WAIST].z, 0, 0, 0,
|
||||
Player_GetMeleeWeaponHeld(this) | arg2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3586,7 +3587,7 @@ void func_8083821C(Player* this) {
|
|||
s32 i;
|
||||
|
||||
// clang-format off
|
||||
for (i = 0; i < 18; i++) { this->flameTimers[i] = Rand_S16Offset(0, 200); }
|
||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++) { this->flameTimers[i] = Rand_S16Offset(0, 200); }
|
||||
// clang-format on
|
||||
|
||||
this->isBurning = true;
|
||||
|
@ -5428,8 +5429,8 @@ s32 func_8083CFA8(GlobalContext* globalCtx, Player* this, f32 arg2, s32 splashSc
|
|||
s32 splashType;
|
||||
|
||||
if (sp3C > 2.0f) {
|
||||
splashPos.x = this->bodyPartsPos[0].x;
|
||||
splashPos.z = this->bodyPartsPos[0].z;
|
||||
splashPos.x = this->bodyPartsPos[PLAYER_BODYPART_WAIST].x;
|
||||
splashPos.z = this->bodyPartsPos[PLAYER_BODYPART_WAIST].z;
|
||||
sp34 = this->actor.world.pos.y;
|
||||
if (WaterBox_GetSurface1(globalCtx, &globalCtx->colCtx, splashPos.x, splashPos.z, &sp34, &sp38)) {
|
||||
if ((sp34 - this->actor.world.pos.y) < 100.0f) {
|
||||
|
@ -5634,8 +5635,9 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) {
|
|||
|
||||
if (this->actor.bgCheckFlags & BGCHECKFLAG_WATER) {
|
||||
if (this->actor.yDistToWater < 50.0f) {
|
||||
temp4 = fabsf(this->bodyPartsPos[0].x - this->unk_A88.x) +
|
||||
fabsf(this->bodyPartsPos[0].y - this->unk_A88.y) + fabsf(this->bodyPartsPos[0].z - this->unk_A88.z);
|
||||
temp4 = fabsf(this->bodyPartsPos[PLAYER_BODYPART_WAIST].x - this->unk_A88.x) +
|
||||
fabsf(this->bodyPartsPos[PLAYER_BODYPART_WAIST].y - this->unk_A88.y) +
|
||||
fabsf(this->bodyPartsPos[PLAYER_BODYPART_WAIST].z - this->unk_A88.z);
|
||||
if (temp4 > 4.0f) {
|
||||
temp4 = 4.0f;
|
||||
}
|
||||
|
@ -5650,7 +5652,8 @@ void func_8083D6EC(GlobalContext* globalCtx, Player* this) {
|
|||
EffectSsGRipple_Spawn(globalCtx, &ripplePos, 100, 500, 0);
|
||||
|
||||
if ((this->linearVelocity > 4.0f) && !func_808332B8(this) &&
|
||||
((this->actor.world.pos.y + this->actor.yDistToWater) < this->bodyPartsPos[0].y)) {
|
||||
((this->actor.world.pos.y + this->actor.yDistToWater) <
|
||||
this->bodyPartsPos[PLAYER_BODYPART_WAIST].y)) {
|
||||
func_8083CFA8(globalCtx, this, 20.0f,
|
||||
(fabsf(this->linearVelocity) * 50.0f) + (this->actor.yDistToWater * 5.0f));
|
||||
}
|
||||
|
@ -5683,7 +5686,7 @@ s32 func_8083DB98(Player* this, s32 arg1) {
|
|||
s16 sp2C;
|
||||
|
||||
sp30.x = this->actor.world.pos.x;
|
||||
sp30.y = this->bodyPartsPos[7].y + 3.0f;
|
||||
sp30.y = this->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 3.0f;
|
||||
sp30.z = this->actor.world.pos.z;
|
||||
sp2E = Math_Vec3f_Pitch(&sp30, &unk_664->focus.pos);
|
||||
sp2C = Math_Vec3f_Yaw(&sp30, &unk_664->focus.pos);
|
||||
|
@ -7455,7 +7458,8 @@ void func_80842A88(GlobalContext* globalCtx, Player* this) {
|
|||
s32 func_80842AC4(GlobalContext* globalCtx, Player* this) {
|
||||
if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_85C > 0.5f)) {
|
||||
if (AMMO(ITEM_STICK) != 0) {
|
||||
EffectSsStick_Spawn(globalCtx, &this->bodyPartsPos[15], this->actor.shape.rot.y + 0x8000);
|
||||
EffectSsStick_Spawn(globalCtx, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND],
|
||||
this->actor.shape.rot.y + 0x8000);
|
||||
this->unk_85C = 0.5f;
|
||||
func_80842A88(globalCtx, this);
|
||||
func_8002F7DC(&this->actor, NA_SE_IT_WOODSTICK_BROKEN);
|
||||
|
@ -7471,7 +7475,8 @@ s32 func_80842B7C(GlobalContext* globalCtx, Player* this) {
|
|||
if (this->heldItemActionParam == PLAYER_AP_SWORD_BGS) {
|
||||
if (!gSaveContext.bgsFlag && (gSaveContext.swordHealth > 0.0f)) {
|
||||
if ((gSaveContext.swordHealth -= 1.0f) <= 0.0f) {
|
||||
EffectSsStick_Spawn(globalCtx, &this->bodyPartsPos[15], this->actor.shape.rot.y + 0x8000);
|
||||
EffectSsStick_Spawn(globalCtx, &this->bodyPartsPos[PLAYER_BODYPART_R_HAND],
|
||||
this->actor.shape.rot.y + 0x8000);
|
||||
func_800849EC(globalCtx);
|
||||
func_8002F7DC(&this->actor, NA_SE_IT_MAJIN_SWORD_BROKEN);
|
||||
}
|
||||
|
@ -9798,7 +9803,7 @@ void func_80848B44(GlobalContext* globalCtx, Player* this) {
|
|||
shockScale = 40;
|
||||
}
|
||||
|
||||
randBodyPart = this->bodyPartsPos + (s32)Rand_ZeroFloat(17.9f);
|
||||
randBodyPart = this->bodyPartsPos + (s32)Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
shockPos.x = (Rand_CenteredFloat(5.0f) + randBodyPart->x) - this->actor.world.pos.x;
|
||||
shockPos.y = (Rand_CenteredFloat(5.0f) + randBodyPart->y) - this->actor.world.pos.y;
|
||||
shockPos.z = (Rand_CenteredFloat(5.0f) + randBodyPart->z) - this->actor.world.pos.z;
|
||||
|
@ -9836,7 +9841,7 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) {
|
|||
|
||||
func_8083819C(this, globalCtx);
|
||||
|
||||
for (i = 0; i < 18; i++, timerPtr++) {
|
||||
for (i = 0; i < PLAYER_BODYPART_MAX; i++, timerPtr++) {
|
||||
timerStep = sp58 + sp54;
|
||||
|
||||
if (*timerPtr <= timerStep) {
|
||||
|
@ -10243,8 +10248,10 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
|
|||
this->unk_8A1 = 0;
|
||||
this->unk_684 = NULL;
|
||||
|
||||
phi_f12 = ((this->bodyPartsPos[6].y + this->bodyPartsPos[3].y) * 0.5f) + temp_f0;
|
||||
temp_f0 += this->bodyPartsPos[7].y + 10.0f;
|
||||
phi_f12 =
|
||||
((this->bodyPartsPos[PLAYER_BODYPART_L_FOOT].y + this->bodyPartsPos[PLAYER_BODYPART_R_FOOT].y) * 0.5f) +
|
||||
temp_f0;
|
||||
temp_f0 += this->bodyPartsPos[PLAYER_BODYPART_HEAD].y + 10.0f;
|
||||
|
||||
this->cylinder.dim.height = temp_f0 - phi_f12;
|
||||
|
||||
|
@ -10279,7 +10286,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
|
|||
}
|
||||
|
||||
Math_Vec3f_Copy(&this->actor.home.pos, &this->actor.world.pos);
|
||||
Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[0]);
|
||||
Math_Vec3f_Copy(&this->unk_A88, &this->bodyPartsPos[PLAYER_BODYPART_WAIST]);
|
||||
|
||||
if (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_28 | PLAYER_STATE1_29)) {
|
||||
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
|
||||
|
@ -11981,8 +11988,9 @@ void func_8084E604(Player* this, GlobalContext* globalCtx) {
|
|||
func_8083A098(this, &gPlayerAnim_003050, globalCtx);
|
||||
} else if (LinkAnimation_OnFrame(&this->skelAnime, 3.0f)) {
|
||||
Inventory_ChangeAmmo(ITEM_NUT, -1);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->bodyPartsPos[15].x, this->bodyPartsPos[15].y,
|
||||
this->bodyPartsPos[15].z, 4000, this->actor.shape.rot.y, 0, ARROW_NUT);
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ARROW, this->bodyPartsPos[PLAYER_BODYPART_R_HAND].x,
|
||||
this->bodyPartsPos[PLAYER_BODYPART_R_HAND].y, this->bodyPartsPos[PLAYER_BODYPART_R_HAND].z, 4000,
|
||||
this->actor.shape.rot.y, 0, ARROW_NUT);
|
||||
func_80832698(this, NA_SE_VO_LI_SWORD_N);
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ void EffectSsFhgFlash_UpdateLightBall(GlobalContext* globalCtx, u32 index, Effec
|
|||
}
|
||||
|
||||
void EffectSsFhgFlash_UpdateShock(GlobalContext* globalCtx, u32 index, EffectSs* this) {
|
||||
s16 randBodypart;
|
||||
s16 randBodyPart;
|
||||
Player* player;
|
||||
BossGanondrof* phantomGanon;
|
||||
s16 rand;
|
||||
|
@ -179,16 +179,16 @@ void EffectSsFhgFlash_UpdateShock(GlobalContext* globalCtx, u32 index, EffectSs*
|
|||
|
||||
if (this->rParam == FHGFLASH_SHOCK_PLAYER) {
|
||||
player = GET_PLAYER(globalCtx);
|
||||
randBodypart = Rand_ZeroFloat(17.9f);
|
||||
this->pos.x = player->bodyPartsPos[randBodypart].x + Rand_CenteredFloat(10.0f);
|
||||
this->pos.y = player->bodyPartsPos[randBodypart].y + Rand_CenteredFloat(15.0f);
|
||||
this->pos.z = player->bodyPartsPos[randBodypart].z + Rand_CenteredFloat(10.0f);
|
||||
randBodyPart = Rand_ZeroFloat(PLAYER_BODYPART_MAX - 0.1f);
|
||||
this->pos.x = player->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(10.0f);
|
||||
this->pos.y = player->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(15.0f);
|
||||
this->pos.z = player->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(10.0f);
|
||||
} else if (this->rParam == FHGFLASH_SHOCK_PG) {
|
||||
phantomGanon = (BossGanondrof*)this->actor;
|
||||
randBodypart = Rand_ZeroFloat(23.9f);
|
||||
this->pos.x = phantomGanon->bodyPartsPos[randBodypart].x + Rand_CenteredFloat(15.0f);
|
||||
this->pos.y = phantomGanon->bodyPartsPos[randBodypart].y + Rand_CenteredFloat(20.0f);
|
||||
this->pos.z = phantomGanon->bodyPartsPos[randBodypart].z + Rand_CenteredFloat(15.0f);
|
||||
randBodyPart = Rand_ZeroFloat(23.9f);
|
||||
this->pos.x = phantomGanon->bodyPartsPos[randBodyPart].x + Rand_CenteredFloat(15.0f);
|
||||
this->pos.y = phantomGanon->bodyPartsPos[randBodyPart].y + Rand_CenteredFloat(20.0f);
|
||||
this->pos.z = phantomGanon->bodyPartsPos[randBodyPart].z + Rand_CenteredFloat(15.0f);
|
||||
}
|
||||
|
||||
if (this->life < 100) {
|
||||
|
|
Loading…
Add table
Reference in a new issue