1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-27 07:07:09 +00:00

sword -> meleeWeapon (#1147)

This commit is contained in:
Dragorn421 2022-02-21 00:45:12 +01:00 committed by GitHub
parent b9cc31dc74
commit 145b14dbc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 194 additions and 182 deletions

View file

@ -1080,8 +1080,8 @@ s32 Player_HasMirrorShieldSetToDraw(GlobalContext* globalCtx);
s32 Player_ActionToMagicSpell(Player* player, s32 actionParam);
s32 Player_HoldsHookshot(Player* player);
s32 func_8008F128(Player* player);
s32 Player_ActionToSword(s32 actionParam);
s32 Player_GetSwordHeld(Player* player);
s32 Player_ActionToMeleeWeapon(s32 actionParam);
s32 Player_GetMeleeWeaponHeld(Player* player);
s32 Player_HoldsTwoHandedWeapon(Player* player);
s32 Player_HoldsBrokenKnife(Player* player);
s32 Player_ActionToBottle(Player* player, s32 actionParam);

View file

@ -346,12 +346,12 @@ typedef struct Player {
/* 0x046C */ s16 unk_46C;
/* 0x046E */ char unk_46E[0x02A];
/* 0x0498 */ ColliderCylinder cylinder;
/* 0x04E4 */ ColliderQuad swordQuads[2];
/* 0x04E4 */ ColliderQuad meleeWeaponQuads[2];
/* 0x05E4 */ ColliderQuad shieldQuad;
/* 0x0664 */ Actor* unk_664;
/* 0x0668 */ char unk_668[0x004];
/* 0x066C */ s32 unk_66C;
/* 0x0670 */ s32 swordEffectIndex;
/* 0x0670 */ s32 meleeWeaponEffectIndex;
/* 0x0674 */ PlayerFunc674 func_674;
/* 0x0678 */ PlayerAgeProperties* ageProperties;
/* 0x067C */ u32 stateFlags1;
@ -393,8 +393,8 @@ typedef struct Player {
/* 0x083C */ s16 currentYaw;
/* 0x083E */ s16 targetYaw;
/* 0x0840 */ u16 unk_840;
/* 0x0842 */ s8 swordAnimation;
/* 0x0843 */ s8 swordState;
/* 0x0842 */ s8 meleeWeaponAnimation;
/* 0x0843 */ s8 meleeWeaponState;
/* 0x0844 */ s8 unk_844;
/* 0x0845 */ u8 unk_845;
/* 0x0846 */ u8 unk_846;
@ -439,7 +439,7 @@ typedef struct Player {
/* 0x08A8 */ f32 unk_8A8;
/* 0x08AC */ f32 windSpeed;
/* 0x08B0 */ s16 windDirection;
/* 0x08B4 */ WeaponInfo swordInfo[3];
/* 0x08B4 */ WeaponInfo meleeWeaponInfo[3];
/* 0x0908 */ Vec3f bodyPartsPos[18];
/* 0x09E0 */ MtxF mf_9E0;
/* 0x0A20 */ MtxF shieldMf;

View file

@ -3999,7 +3999,8 @@ s32 func_800354B4(GlobalContext* globalCtx, Actor* actor, f32 range, s16 arg3, s
var1 = (s16)(actor->yawTowardsPlayer + 0x8000) - player->actor.shape.rot.y;
var2 = actor->yawTowardsPlayer - arg5;
if ((actor->xzDistToPlayer <= range) && (player->swordState != 0) && (arg4 >= ABS(var1)) && (arg3 >= ABS(var2))) {
if ((actor->xzDistToPlayer <= range) && (player->meleeWeaponState != 0) && (arg4 >= ABS(var1)) &&
(arg3 >= ABS(var2))) {
return true;
} else {
return false;
@ -4039,7 +4040,8 @@ void func_800355B8(GlobalContext* globalCtx, Vec3f* pos) {
u8 func_800355E4(GlobalContext* globalCtx, Collider* collider) {
Player* player = GET_PLAYER(globalCtx);
if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) {
if ((collider->acFlags & AC_TYPE_PLAYER) && (player->meleeWeaponState != 0) &&
(player->meleeWeaponAnimation == 0x16)) {
return true;
} else {
return false;

View file

@ -2928,7 +2928,7 @@ s32 Camera_Battle1(Camera* camera) {
}
anim->roll += (((OREG(36) * camera->speedRatio) * (1.0f - distRatio)) - anim->roll) * PCT(OREG(37));
camera->roll = DEGF_TO_BINANG(anim->roll);
camera->fov = Camera_LERPCeilF((player->swordState != 0 ? 0.8f
camera->fov = Camera_LERPCeilF((player->meleeWeaponState != 0 ? 0.8f
: gSaveContext.health <= 0x10 ? 0.8f
: 1.0f) *
(fov - ((fov * 0.05f) * distRatio)),

View file

@ -477,7 +477,7 @@ s32 Player_IsBurningStickInRange(GlobalContext* globalCtx, Vec3f* pos, f32 xzRan
s32 pad;
if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_860 != 0)) {
Math_Vec3f_Diff(&this->swordInfo[0].tip, pos, &diff);
Math_Vec3f_Diff(&this->meleeWeaponInfo[0].tip, pos, &diff);
return ((SQ(diff.x) + SQ(diff.z)) <= SQ(xzRange)) && (0.0f <= diff.y) && (diff.y <= yRange);
} else {
return false;
@ -540,7 +540,7 @@ s32 func_8008F128(Player* this) {
return Player_HoldsHookshot(this) && (this->heldActor == NULL);
}
s32 Player_ActionToSword(s32 actionParam) {
s32 Player_ActionToMeleeWeapon(s32 actionParam) {
s32 sword = actionParam - PLAYER_AP_FISHING_POLE;
if ((sword > 0) && (sword < 6)) {
@ -550,8 +550,8 @@ s32 Player_ActionToSword(s32 actionParam) {
}
}
s32 Player_GetSwordHeld(Player* this) {
return Player_ActionToSword(this->heldItemActionParam);
s32 Player_GetMeleeWeaponHeld(Player* this) {
return Player_ActionToMeleeWeapon(this->heldItemActionParam);
}
s32 Player_HoldsTwoHandedWeapon(Player* this) {
@ -881,7 +881,7 @@ 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->swordInfo[2].base;
D_80160000 = &this->meleeWeaponInfo[2].base;
if (!LINK_IS_ADULT) {
if (!(this->skelAnime.moveFlags & 4) || (this->skelAnime.moveFlags & 1)) {
@ -1098,15 +1098,16 @@ void func_800906D4(GlobalContext* globalCtx, Player* this, Vec3f* newTipPos) {
Matrix_MultVec3f(&D_801260A4[1], &newBasePos[1]);
Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]);
if (func_80090480(globalCtx, NULL, &this->swordInfo[0], &newTipPos[0], &newBasePos[0]) &&
if (func_80090480(globalCtx, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) &&
!(this->stateFlags1 & PLAYER_STATE1_22)) {
EffectBlure_AddVertex(Effect_GetByIndex(this->swordEffectIndex), &this->swordInfo[0].tip,
&this->swordInfo[0].base);
EffectBlure_AddVertex(Effect_GetByIndex(this->meleeWeaponEffectIndex), &this->meleeWeaponInfo[0].tip,
&this->meleeWeaponInfo[0].base);
}
if ((this->swordState > 0) && ((this->swordAnimation < 0x18) || (this->stateFlags2 & PLAYER_STATE2_17))) {
func_80090480(globalCtx, &this->swordQuads[0], &this->swordInfo[1], &newTipPos[1], &newBasePos[1]);
func_80090480(globalCtx, &this->swordQuads[1], &this->swordInfo[2], &newTipPos[2], &newBasePos[2]);
if ((this->meleeWeaponState > 0) &&
((this->meleeWeaponAnimation < 0x18) || (this->stateFlags2 & PLAYER_STATE2_17))) {
func_80090480(globalCtx, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]);
func_80090480(globalCtx, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]);
}
}
@ -1194,7 +1195,7 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2
Vec3f D_801260D4 = { 1100.0f, -700.0f, 0.0f };
f32 sSwordLengths[] = {
f32 sMeleeWeaponLengths[] = {
0.0f, 4000.0f, 3000.0f, 5500.0f, 0.0f, 2500.0f,
};
@ -1259,10 +1260,10 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
if (this->actor.scale.y >= 0.0f) {
D_80126080.x = this->unk_85C * 5000.0f;
func_80090A28(this, sp124);
if (this->swordState != 0) {
if (this->meleeWeaponState != 0) {
func_800906D4(globalCtx, this, sp124);
} else {
Math_Vec3f_Copy(&this->swordInfo[0].tip, &sp124[0]);
Math_Vec3f_Copy(&this->meleeWeaponInfo[0].tip, &sp124[0]);
}
}
@ -1275,13 +1276,13 @@ void func_80090D20(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
gSPDisplayList(POLY_OPA_DISP++, gLinkChildLinkDekuStickDL);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2656);
} else if ((this->actor.scale.y >= 0.0f) && (this->swordState != 0)) {
} else if ((this->actor.scale.y >= 0.0f) && (this->meleeWeaponState != 0)) {
Vec3f spE4[3];
if (Player_HoldsBrokenKnife(this)) {
D_80126080.x = 1500.0f;
} else {
D_80126080.x = sSwordLengths[Player_GetSwordHeld(this)];
D_80126080.x = sMeleeWeaponLengths[Player_GetMeleeWeaponHeld(this)];
}
func_80090A28(this, spE4);

View file

@ -126,7 +126,7 @@ void BgHidanDalm_Wait(BgHidanDalm* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(globalCtx) &&
(player->swordAnimation == 22 || player->swordAnimation == 23)) {
(player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23)) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT)) {

View file

@ -279,8 +279,8 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, GlobalContext* globalCtx) {
webPos.y = this->dyna.actor.world.pos.y - 50.0f;
webPos.z = this->dyna.actor.world.pos.z;
if (Player_IsBurningStickInRange(globalCtx, &webPos, 70.0f, 50.0f) != 0) {
this->dyna.actor.home.pos.x = player->swordInfo[0].tip.x;
this->dyna.actor.home.pos.z = player->swordInfo[0].tip.z;
this->dyna.actor.home.pos.x = player->meleeWeaponInfo[0].tip.x;
this->dyna.actor.home.pos.z = player->meleeWeaponInfo[0].tip.z;
BgYdanSp_BurnWeb(this, globalCtx);
return;
}
@ -400,10 +400,10 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, GlobalContext* globalCtx) {
this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f;
BgYdanSp_BurnWeb(this, globalCtx);
} else if (player->heldItemActionParam == PLAYER_AP_STICK && player->unk_860 != 0) {
func_8002DBD0(&this->dyna.actor, &sp30, &player->swordInfo[0].tip);
func_8002DBD0(&this->dyna.actor, &sp30, &player->meleeWeaponInfo[0].tip);
if (fabsf(sp30.x) < 100.0f && sp30.z < 1.0f && sp30.y < 200.0f) {
OnePointCutscene_Init(globalCtx, 3020, 40, &this->dyna.actor, MAIN_CAM);
Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->swordInfo[0].tip);
Math_Vec3f_Copy(&this->dyna.actor.home.pos, &player->meleeWeaponInfo[0].tip);
BgYdanSp_BurnWeb(this, globalCtx);
}
}

View file

@ -3968,7 +3968,7 @@ void BossGanon_LightBall_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
// if a spin attack is used
if (player->swordAnimation >= 0x18) {
if (player->meleeWeaponAnimation >= 0x18) {
this->actor.speedXZ = 20.0f;
}
break;
@ -4410,7 +4410,8 @@ void func_808E2544(Actor* thisx, GlobalContext* globalCtx) {
this->actor.world.rot.x = (Math_CosS(this->unk_1A2 * 0x3400) * sp84 * 0.1f) + this->actor.shape.rot.x;
this->actor.world.rot.y = (Math_SinS(this->unk_1A2 * 0x1A00) * sp84) + this->actor.shape.rot.y;
if ((player->swordState != 0) && (player->swordAnimation >= 0x18) && (this->actor.xzDistToPlayer < 80.0f)) {
if ((player->meleeWeaponState != 0) && (player->meleeWeaponAnimation >= 0x18) &&
(this->actor.xzDistToPlayer < 80.0f)) {
this->unk_1C2 = 0xC;
this->actor.speedXZ = -30.0f;
func_8002D908(&this->actor);

View file

@ -1624,7 +1624,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) {
temp_f12 = this->unk_1B8.z - player->actor.world.pos.z;
temp_a0_2 = Math_Atan2S(temp_f12, temp_f14) - player->actor.shape.rot.y;
if ((ABS(temp_a0_2) < 0x2000) && (sqrtf(SQ(temp_f14) + SQ(temp_f12)) < 70.0f) &&
(player->swordState != 0) && (player->heldItemActionParam == PLAYER_AP_SWORD_MASTER)) {
(player->meleeWeaponState != 0) && (player->heldItemActionParam == PLAYER_AP_SWORD_MASTER)) {
func_80064520(globalCtx, &globalCtx->csCtx);
this->unk_39E = Gameplay_CreateSubCamera(globalCtx);
Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT);

View file

@ -221,7 +221,7 @@ void EnAnubice_Idle(EnAnubice* this, GlobalContext* globalCtx) {
if (this->actor.shape.yOffset > -2.0f) {
this->actor.shape.yOffset = 0.0f;
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
this->actionFunc = EnAnubice_SetupShootFireball;
} else if (this->isPlayerOutOfRange) {
this->actor.velocity.y = 0.0f;

View file

@ -305,9 +305,9 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) {
minAnimSpeed = 0.0f;
if ((this->flightParamsIdx != 0) && (this->timer < 12)) {
swordTip.x = player->swordInfo[0].tip.x + Math_SinS(player->actor.shape.rot.y) * 10.0f;
swordTip.y = player->swordInfo[0].tip.y;
swordTip.z = player->swordInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f;
swordTip.x = player->meleeWeaponInfo[0].tip.x + Math_SinS(player->actor.shape.rot.y) * 10.0f;
swordTip.y = player->meleeWeaponInfo[0].tip.y;
swordTip.z = player->meleeWeaponInfo[0].tip.z + Math_CosS(player->actor.shape.rot.y) * 10.0f;
yaw = Math_Vec3f_Yaw(&this->actor.world.pos, &swordTip) + (s16)(Rand_ZeroOne() * D_809CE410);
if (Math_ScaledStepToS(&this->actor.world.rot.y, yaw, 2000) != 0) {
@ -319,7 +319,7 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) {
}
}
this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->swordInfo[0].tip.y);
this->posYTarget = MAX(player->actor.world.pos.y + 30.0f, player->meleeWeaponInfo[0].tip.y);
EnButte_Turn(this);
@ -339,7 +339,7 @@ void EnButte_FollowLink(EnButte* this, GlobalContext* globalCtx) {
(this->swordDownTimer <= 0) && (distSqFromHome < SQ(320.0f)))) {
EnButte_SetupFlyAround(this);
} else if (distSqFromHome > SQ(240.0f)) {
distSqFromSword = Math3D_Dist2DSq(player->swordInfo[0].tip.x, player->swordInfo[0].tip.z,
distSqFromSword = Math3D_Dist2DSq(player->meleeWeaponInfo[0].tip.x, player->meleeWeaponInfo[0].tip.z,
this->actor.world.pos.x, this->actor.world.pos.z);
if (distSqFromSword < SQ(60.0f)) {
EnButte_SetupTransformIntoFairy(this);
@ -398,7 +398,7 @@ void EnButte_Update(Actor* thisx, GlobalContext* globalCtx) {
this->unk_260 += 0x600;
if ((this->actor.params & 1) == 1) {
if (GET_PLAYER(globalCtx)->swordState == 0) {
if (GET_PLAYER(globalCtx)->meleeWeaponState == 0) {
if (this->swordDownTimer > 0) {
this->swordDownTimer--;
}

View file

@ -509,7 +509,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, GlobalContext* globalCtx) {
this->work[FHGFIRE_RETURN_COUNT] = 100;
}
if (!canBottleReflect2 && (player->swordAnimation >= 24)) {
if (!canBottleReflect2 && (player->meleeWeaponAnimation >= 24)) {
this->actor.speedXZ = 20.0f;
this->work[FHGFIRE_RETURN_COUNT] = 4;
} else {

View file

@ -282,7 +282,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
angleToLink = ABS(angleToLink);
if (func_800354B4(globalCtx, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
return true;
} else if (globalCtx->gameplayFrames & 1) {
@ -296,7 +296,7 @@ s32 EnGeldB_ReactToPlayer(GlobalContext* globalCtx, EnGeldB* this, s16 arg2) {
(thisx->xzDistToPlayer < 90.0f)) {
EnGeldB_SetupJump(this);
return true;
} else if (player->swordAnimation == 0x11) {
} else if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
return true;
} else if ((thisx->xzDistToPlayer < 90.0f) && (globalCtx->gameplayFrames & 1)) {
@ -444,7 +444,7 @@ void EnGeldB_Ready(EnGeldB* this, GlobalContext* globalCtx) {
return;
}
angleToLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && (ABS(angleToLink) >= 0x1F40)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0) && (ABS(angleToLink) >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnGeldB_SetupCircle(this);
} else if (--this->timer == 0) {
@ -500,7 +500,7 @@ void EnGeldB_Advance(EnGeldB* this, GlobalContext* globalCtx) {
this->skelAnime.playSpeed = this->actor.speedXZ / 8.0f;
facingAngletoLink = player->actor.shape.rot.y - this->actor.shape.rot.y;
facingAngletoLink = ABS(facingAngletoLink);
if ((this->actor.xzDistToPlayer < 150.0f) && (player->swordState != 0) && (facingAngletoLink >= 0x1F40)) {
if ((this->actor.xzDistToPlayer < 150.0f) && (player->meleeWeaponState != 0) && (facingAngletoLink >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f) {
EnGeldB_SetupCircle(this);
@ -1141,7 +1141,7 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) {
if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) &&
(ABS(this->actor.yDistToPlayer) < 50.0f)) {
if (func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
} else if (globalCtx->gameplayFrames & 1) {
EnGeldB_SetupBlock(this);
@ -1162,7 +1162,7 @@ void EnGeldB_Block(EnGeldB* this, GlobalContext* globalCtx) {
}
} else if ((this->timer == 0) &&
func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, globalCtx);
} else if (!EnGeldB_DodgeRanged(globalCtx, this)) {
if ((globalCtx->gameplayFrames & 1)) {

View file

@ -727,7 +727,7 @@ void EnGoma_Update(Actor* thisx, GlobalContext* globalCtx) {
EnGoma_LookAtPlayer(this, globalCtx);
EnGoma_UpdateEyeEnvColor(this);
this->visualState = 1;
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
this->colCyl2.dim.radius = 35;
this->colCyl2.dim.height = 35;
this->colCyl2.dim.yShift = 0;

View file

@ -286,7 +286,7 @@ void EnKanban_Update(Actor* thisx, GlobalContext* globalCtx2) {
u8 i;
if (hitItem->toucher.dmgFlags & 0x700) {
this->cutType = sCutTypes[player->swordAnimation];
this->cutType = sCutTypes[player->meleeWeaponAnimation];
} else {
this->cutType = CUT_POST;
}

View file

@ -131,7 +131,7 @@ void func_80A9F350(EnMThunder* this, GlobalContext* globalCtx) {
Player* player = GET_PLAYER(globalCtx);
if (player->stateFlags2 & PLAYER_STATE2_17) {
if (player->swordAnimation >= 0x18) {
if (player->meleeWeaponAnimation >= 0x18) {
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
@ -181,7 +181,7 @@ void func_80A9F408(EnMThunder* this, GlobalContext* globalCtx) {
}
if (player->unk_858 <= 0.15f) {
if ((player->unk_858 >= 0.1f) && (player->swordAnimation >= 0x18)) {
if ((player->unk_858 >= 0.1f) && (player->meleeWeaponAnimation >= 0x18)) {
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &D_801333E0,

View file

@ -339,7 +339,7 @@ void func_80AD97C8(EnPoSisters* this, GlobalContext* globalCtx) {
f32 sp20;
if (this->unk_195 == 0 || this->actionFunc != func_80ADAAA4) {
if ((player->swordState == 0 || player->swordAnimation >= 24) &&
if ((player->meleeWeaponState == 0 || player->meleeWeaponAnimation >= 24) &&
player->actor.world.pos.y - player->actor.floorHeight < 1.0f) {
Math_StepToF(&this->unk_294, 110.0f, 3.0f);
} else {

View file

@ -479,8 +479,8 @@ void func_80AFD968(EnSkb* this, GlobalContext* globalCtx) {
if (this->unk_283 == 0) {
if ((this->actor.colChkInfo.damageEffect == 0xD) ||
((this->actor.colChkInfo.damageEffect == 0xE) &&
((player->swordAnimation >= 4 && player->swordAnimation <= 11) ||
(player->swordAnimation == 20 || player->swordAnimation == 21)))) {
((player->meleeWeaponAnimation >= 4 && player->meleeWeaponAnimation <= 11) ||
(player->meleeWeaponAnimation == 20 || player->meleeWeaponAnimation == 21)))) {
BodyBreak_Alloc(&this->bodyBreak, 2, globalCtx);
this->unk_283 = 1;
}

View file

@ -492,10 +492,10 @@ void EnTest_Idle(EnTest* this, GlobalContext* globalCtx) {
yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 100.0f) {
if ((player->swordState != 0) && (ABS(yawDiff) >= 0x1F40)) {
if ((player->meleeWeaponState != 0) && (ABS(yawDiff) >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if (Rand_ZeroOne() > 0.7f && player->swordAnimation != 0x11) {
if (Rand_ZeroOne() > 0.7f && player->meleeWeaponAnimation != 0x11) {
EnTest_SetupJumpBack(this);
} else {
func_808627C4(this, globalCtx);
@ -622,11 +622,11 @@ void EnTest_WalkAndBlock(EnTest* this, GlobalContext* globalCtx) {
yawDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0)) {
if (ABS(yawDiff) >= 0x1F40) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
if ((Rand_ZeroOne() > 0.7f) && (player->swordAnimation != 0x11)) {
if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1233,13 +1233,13 @@ void func_808621D4(EnTest* this, GlobalContext* globalCtx) {
}
}
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
(player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1273,13 +1273,13 @@ void func_80862418(EnTest* this, GlobalContext* globalCtx) {
}
}
if (player->swordState != 0) {
if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (this->actor.params != STALFOS_TYPE_CEILING) &&
(player->swordAnimation != 0x11)) {
(player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);
@ -1320,12 +1320,12 @@ void EnTest_Stunned(EnTest* this, GlobalContext* globalCtx) {
if (this->actor.colorFilterTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
func_80862FA8(this, globalCtx);
} else if (player->swordState != 0) {
} else if (player->meleeWeaponState != 0) {
if ((this->actor.bgCheckFlags & BGCHECKFLAG_WALL) &&
((ABS((s16)(this->actor.wallYaw - this->actor.shape.rot.y)) < 0x38A4) &&
(this->actor.xzDistToPlayer < 80.0f))) {
EnTest_SetupJumpUp(this);
} else if ((Rand_ZeroOne() > 0.7f) && (player->swordAnimation != 0x11)) {
} else if ((Rand_ZeroOne() > 0.7f) && (player->meleeWeaponAnimation != 0x11)) {
EnTest_SetupJumpBack(this);
} else {
EnTest_SetupStopAndBlock(this);

View file

@ -132,11 +132,11 @@ void EnTorch2_Init(Actor* thisx, GlobalContext* globalCtx2) {
globalCtx->playerInit(this, globalCtx, &gDarkLinkSkel);
this->actor.naviEnemyId = 0x26;
this->cylinder.base.acFlags = AC_ON | AC_TYPE_PLAYER;
this->swordQuads[0].base.atFlags = this->swordQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY;
this->swordQuads[0].base.acFlags = this->swordQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER;
this->swordQuads[0].base.colType = this->swordQuads[1].base.colType = COLTYPE_METAL;
this->swordQuads[0].info.toucher.damage = this->swordQuads[1].info.toucher.damage = 8;
this->swordQuads[0].info.bumperFlags = this->swordQuads[1].info.bumperFlags = BUMP_ON;
this->meleeWeaponQuads[0].base.atFlags = this->meleeWeaponQuads[1].base.atFlags = AT_ON | AT_TYPE_ENEMY;
this->meleeWeaponQuads[0].base.acFlags = this->meleeWeaponQuads[1].base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER;
this->meleeWeaponQuads[0].base.colType = this->meleeWeaponQuads[1].base.colType = COLTYPE_METAL;
this->meleeWeaponQuads[0].info.toucher.damage = this->meleeWeaponQuads[1].info.toucher.damage = 8;
this->meleeWeaponQuads[0].info.bumperFlags = this->meleeWeaponQuads[1].info.bumperFlags = BUMP_ON;
this->shieldQuad.base.atFlags = AT_ON | AT_TYPE_ENEMY;
this->shieldQuad.base.acFlags = AC_ON | AC_HARD | AC_TYPE_PLAYER;
this->actor.colChkInfo.damageTable = &sDamageTable;
@ -161,11 +161,11 @@ void EnTorch2_Destroy(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
Player* this = (Player*)thisx;
Effect_Delete(globalCtx, this->swordEffectIndex);
Effect_Delete(globalCtx, this->meleeWeaponEffectIndex);
func_800F5B58();
Collider_DestroyCylinder(globalCtx, &this->cylinder);
Collider_DestroyQuad(globalCtx, &this->swordQuads[0]);
Collider_DestroyQuad(globalCtx, &this->swordQuads[1]);
Collider_DestroyQuad(globalCtx, &this->meleeWeaponQuads[0]);
Collider_DestroyQuad(globalCtx, &this->meleeWeaponQuads[1]);
Collider_DestroyQuad(globalCtx, &this->shieldQuad);
}
@ -279,16 +279,17 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
// Handles Dark Link's sword clanking on Link's sword
if ((this->swordQuads[0].base.acFlags & AC_BOUNCED) || (this->swordQuads[1].base.acFlags & AC_BOUNCED)) {
this->swordQuads[0].base.acFlags &= ~AC_BOUNCED;
this->swordQuads[1].base.acFlags &= ~AC_BOUNCED;
this->swordQuads[0].base.atFlags |= AT_BOUNCED;
this->swordQuads[1].base.atFlags |= AT_BOUNCED;
if ((this->meleeWeaponQuads[0].base.acFlags & AC_BOUNCED) ||
(this->meleeWeaponQuads[1].base.acFlags & AC_BOUNCED)) {
this->meleeWeaponQuads[0].base.acFlags &= ~AC_BOUNCED;
this->meleeWeaponQuads[1].base.acFlags &= ~AC_BOUNCED;
this->meleeWeaponQuads[0].base.atFlags |= AT_BOUNCED;
this->meleeWeaponQuads[1].base.atFlags |= AT_BOUNCED;
this->cylinder.base.acFlags &= ~AC_HIT;
if (sLastSwordAnim != this->swordAnimation) {
if (sLastSwordAnim != this->meleeWeaponAnimation) {
sStaggerCount++;
sLastSwordAnim = this->swordAnimation;
sLastSwordAnim = this->meleeWeaponAnimation;
}
/*! @bug
* This code is needed to reset sCounterState, and should run regardless
@ -302,9 +303,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
sStaggerTimer = 50;
}
}
if ((sCounterState != 0) && (this->swordState != 0)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->swordQuads[0].base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->swordQuads[1].base);
if ((sCounterState != 0) && (this->meleeWeaponState != 0)) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->meleeWeaponQuads[0].base);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->meleeWeaponQuads[1].base);
}
// Ignores hits when jumping on Link's sword
@ -326,8 +327,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
// Handles Dark Link's initial reaction to jumpslashes
if (((player->swordState != 0) || (player->actor.velocity.y > -3.0f)) &&
(player->swordAnimation == JUMPSLASH_START)) {
if (((player->meleeWeaponState != 0) || (player->actor.velocity.y > -3.0f)) &&
(player->meleeWeaponAnimation == JUMPSLASH_START)) {
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
if (globalCtx->gameplayFrames % 2) {
@ -354,7 +355,8 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
player->actor.world.pos.z,
1.0f, 5.0f, 0.0f);
sSwordJumpTimer--;
if (((u32)sSwordJumpTimer == 0) || ((player->invincibilityTimer > 0) && (this->swordState == 0))) {
if (((u32)sSwordJumpTimer == 0) ||
((player->invincibilityTimer > 0) && (this->meleeWeaponState == 0))) {
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
input->cur.button = BTN_A;
player->stateFlags3 &= ~PLAYER_STATE3_2;
@ -381,21 +383,21 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
// Handles Dark Link's reaction to sword attack other than jumpslashes
if (func_800354B4(globalCtx, &this->actor, 120.0f, 0x7FFF, 0x7FFF, this->actor.world.rot.y)) {
if ((player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) {
if ((player->meleeWeaponAnimation == STAB_1H) && (this->actor.xzDistToPlayer < 90.0f)) {
// Handles the reaction to a one-handed stab. If the conditions are satisfied,
// Dark Link jumps on Link's sword. Otherwise he backflips away.
if ((this->swordState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) &&
(player->swordAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) &&
Actor_IsTargeted(globalCtx, &this->actor)) {
if ((this->meleeWeaponState == 0) && (sCounterState == 0) &&
(player->invincibilityTimer == 0) && (player->meleeWeaponAnimation == STAB_1H) &&
(this->actor.xzDistToPlayer <= 85.0f) && Actor_IsTargeted(globalCtx, &this->actor)) {
sStickTilt = 0.0f;
sSwordJumpState = 1;
player->stateFlags3 |= PLAYER_STATE3_2;
this->actor.flags &= ~ACTOR_FLAG_0;
sSwordJumpTimer = 27;
player->swordState = 0;
player->meleeWeaponState = 0;
player->linearVelocity = 0.0f;
this->invincibilityTimer = -7;
this->linearVelocity = 0.0f;
@ -413,23 +415,23 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
sStickAngle = thisx->yawTowardsPlayer;
input->cur.button = BTN_B;
if (player->swordAnimation <= FORWARD_COMBO_2H) {
if (player->meleeWeaponAnimation <= FORWARD_COMBO_2H) {
sStickTilt = 0.0f;
} else if (player->swordAnimation <= RIGHT_COMBO_2H) {
} else if (player->meleeWeaponAnimation <= RIGHT_COMBO_2H) {
sStickTilt = 127.0f;
sStickAngle += 0x4000;
} else if (player->swordAnimation <= LEFT_COMBO_2H) {
} else if (player->meleeWeaponAnimation <= LEFT_COMBO_2H) {
sStickTilt = 127.0f;
sStickAngle -= 0x4000;
} else if (player->swordAnimation <= HAMMER_SIDE) {
} else if (player->meleeWeaponAnimation <= HAMMER_SIDE) {
input->cur.button = BTN_R;
} else if (player->swordAnimation <= BIG_SPIN_2H) {
} else if (player->meleeWeaponAnimation <= BIG_SPIN_2H) {
EnTorch2_Backflip(this, input, &this->actor);
} else {
EnTorch2_Backflip(this, input, &this->actor);
}
if (!CHECK_BTN_ANY(input->cur.button, BTN_A | BTN_R) && (this->swordState == 0) &&
(player->swordState != 0)) {
if (!CHECK_BTN_ANY(input->cur.button, BTN_A | BTN_R) && (this->meleeWeaponState == 0) &&
(player->meleeWeaponState != 0)) {
sCounterState = 1;
}
}
@ -444,9 +446,10 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
(this->actor.isTargeted || !(player->stateFlags1 & PLAYER_STATE1_22))) {
EnTorch2_SwingSword(globalCtx, input, this);
} else if (((this->actor.xzDistToPlayer <= 70.0f) ||
((this->actor.xzDistToPlayer <= 80.0f + sp50) && (player->swordState != 0))) &&
(this->swordState == 0)) {
if (!EnTorch2_SwingSword(globalCtx, input, this) && (this->swordState == 0) &&
((this->actor.xzDistToPlayer <= 80.0f + sp50) &&
(player->meleeWeaponState != 0))) &&
(this->meleeWeaponState == 0)) {
if (!EnTorch2_SwingSword(globalCtx, input, this) && (this->meleeWeaponState == 0) &&
(sCounterState == 0)) {
EnTorch2_Backflip(this, input, &this->actor);
}
@ -457,8 +460,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0);
}
} else if (this->actor.xzDistToPlayer > 100.0f + sp50) {
if ((player->swordState == 0) || (player->swordAnimation < SPIN_ATTACK_1H) ||
(player->swordAnimation > BIG_SPIN_2H) || (this->actor.xzDistToPlayer >= 280.0f)) {
if ((player->meleeWeaponState == 0) || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) ||
(player->meleeWeaponAnimation > BIG_SPIN_2H) ||
(this->actor.xzDistToPlayer >= 280.0f)) {
sStickTilt = 127.0f;
sStickAngle = this->actor.yawTowardsPlayer;
if (!this->actor.isTargeted) {
@ -509,7 +513,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
break;
case ENTORCH2_DAMAGE:
this->swordState = 0;
this->meleeWeaponState = 0;
input->cur.stick_x = input->cur.stick_y = 0;
if ((this->invincibilityTimer > 0) && (this->actor.world.pos.y < (this->actor.floorHeight - 160.0f))) {
this->stateFlags3 &= ~PLAYER_STATE3_0;
@ -556,8 +560,9 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
// Causes Dark Link to shield in place when Link is using magic attacks other than the spin attack
if ((gSaveContext.unk_13F0 == 3) && (player->swordState == 0 || (player->swordAnimation < SPIN_ATTACK_1H) ||
(player->swordAnimation > BIG_SPIN_2H))) {
if ((gSaveContext.unk_13F0 == 3) &&
(player->meleeWeaponState == 0 || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) ||
(player->meleeWeaponAnimation > BIG_SPIN_2H))) {
sStickTilt = 0.0f;
input->cur.stick_x = 0;
input->cur.stick_y = 0;
@ -574,7 +579,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
pad54 = input->prev.button ^ input->cur.button;
input->press.button = input->cur.button & pad54;
if (CHECK_BTN_ANY(input->cur.button, BTN_R)) {
input->cur.button = ((sCounterState == 0) && (this->swordState == 0)) ? BTN_R : input->cur.button ^ BTN_R;
input->cur.button = ((sCounterState == 0) && (this->meleeWeaponState == 0)) ? BTN_R : input->cur.button ^ BTN_R;
}
input->rel.button = input->prev.button & pad54;
input->prev.button = input->cur.button & (u16) ~(BTN_A | BTN_B);
@ -593,7 +598,7 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
}
if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) &&
(this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & PLAYER_STATE1_26) &&
!(this->swordQuads[0].base.atFlags & AT_HIT) && !(this->swordQuads[1].base.atFlags & AT_HIT)) {
!(this->meleeWeaponQuads[0].base.atFlags & AT_HIT) && !(this->meleeWeaponQuads[1].base.atFlags & AT_HIT)) {
if (!Actor_ApplyDamage(&this->actor)) {
func_800F5B58();
@ -695,16 +700,16 @@ void EnTorch2_Update(Actor* thisx, GlobalContext* globalCtx2) {
* This ensures Dark Link's counter animation mirrors Link's exactly.
*/
if ((sCounterState != 0) && (sCounterState == 1)) {
if (this->swordState == 0) {
if (this->meleeWeaponState == 0) {
sCounterState = 0;
} else {
sCounterState = 2;
this->swordState = 1;
this->meleeWeaponState = 1;
this->skelAnime.curFrame = player->skelAnime.curFrame - player->skelAnime.playSpeed;
this->skelAnime.playSpeed = player->skelAnime.playSpeed;
LinkAnimation_Update(globalCtx, &this->skelAnime);
Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base);
Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base);
Collider_ResetQuadAT(globalCtx, &this->meleeWeaponQuads[0].base);
Collider_ResetQuadAT(globalCtx, &this->meleeWeaponQuads[1].base);
}
}
if (sStaggerTimer != 0) {

View file

@ -293,7 +293,7 @@ s32 EnWf_ChangeAction(GlobalContext* globalCtx, EnWf* this, s16 mustChoose) {
playerYawDiff = ABS(playerYawDiff);
if (func_800354B4(globalCtx, &this->actor, 100.0f, 0x2710, 0x2EE0, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
return true;
}
@ -311,7 +311,7 @@ s32 EnWf_ChangeAction(GlobalContext* globalCtx, EnWf* this, s16 mustChoose) {
(this->actor.xzDistToPlayer < 120.0f)) {
EnWf_SetupSomersaultAndAttack(this);
return true;
} else if (player->swordAnimation == 0x11) {
} else if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
return true;
} else if ((this->actor.xzDistToPlayer < 80.0f) && (globalCtx->gameplayFrames % 2) != 0) {
@ -457,7 +457,7 @@ void EnWf_Wait(EnWf* this, GlobalContext* globalCtx) {
angle = player->actor.shape.rot.y - this->actor.shape.rot.y;
angle = ABS(angle);
if ((this->actor.xzDistToPlayer < 80.0f) && (player->swordState != 0) && (angle >= 0x1F40)) {
if ((this->actor.xzDistToPlayer < 80.0f) && (player->meleeWeaponState != 0) && (angle >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
EnWf_SetupRunAroundPlayer(this);
} else {
@ -518,7 +518,7 @@ void EnWf_RunAtPlayer(EnWf* this, GlobalContext* globalCtx) {
playerFacingAngleDiff = player->actor.shape.rot.y - this->actor.shape.rot.y;
playerFacingAngleDiff = ABS(playerFacingAngleDiff);
if ((this->actor.xzDistToPlayer < (150.0f + baseRange)) && (player->swordState != 0) &&
if ((this->actor.xzDistToPlayer < (150.0f + baseRange)) && (player->meleeWeaponState != 0) &&
(playerFacingAngleDiff >= 8000)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
@ -1024,7 +1024,7 @@ void EnWf_Blocking(EnWf* this, GlobalContext* globalCtx) {
if ((ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer < 60.0f) &&
(ABS(this->actor.yDistToPlayer) < 50.0f)) {
if (func_800354B4(globalCtx, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
} else if ((globalCtx->gameplayFrames % 2) != 0) {
EnWf_SetupBlocking(this);
@ -1047,7 +1047,7 @@ void EnWf_Blocking(EnWf* this, GlobalContext* globalCtx) {
}
} else if (this->actionTimer == 0) {
if (func_800354B4(globalCtx, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
} else if ((globalCtx->gameplayFrames % 2) != 0) {
EnWf_SetupBlocking(this);

View file

@ -727,7 +727,7 @@ void func_80B4543C(EnZf* this, GlobalContext* globalCtx) {
angleToPlayer = player->actor.shape.rot.y - this->actor.shape.rot.y;
angleToPlayer = ABS(angleToPlayer);
if ((this->actor.xzDistToPlayer < 100.0f) && (player->swordState != 0) && (angleToPlayer >= 0x1F40)) {
if ((this->actor.xzDistToPlayer < 100.0f) && (player->meleeWeaponState != 0) && (angleToPlayer >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;
func_80B483E4(this, globalCtx);
} else if (this->unk_3F0 != 0) {
@ -844,7 +844,7 @@ void EnZf_ApproachPlayer(EnZf* this, GlobalContext* globalCtx) {
temp_v1 = player->actor.shape.rot.y - this->actor.shape.rot.y;
temp_v1 = ABS(temp_v1);
if ((sp48 == this->curPlatform) && (this->actor.xzDistToPlayer < 150.0f) && (player->swordState != 0) &&
if ((sp48 == this->curPlatform) && (this->actor.xzDistToPlayer < 150.0f) && (player->meleeWeaponState != 0) &&
(temp_v1 >= 0x1F40)) {
this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer;

View file

@ -176,7 +176,7 @@ void ObjSyokudai_Update(Actor* thisx, GlobalContext* globalCtx2) {
interactionType = 1;
}
} else if (player->heldItemActionParam == PLAYER_AP_STICK) {
Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame);
Math_Vec3f_Diff(&player->meleeWeaponInfo[0].tip, &this->actor.world.pos, &tipToFlame);
tipToFlame.y -= 67.0f;
if ((SQ(tipToFlame.x) + SQ(tipToFlame.y) + SQ(tipToFlame.z)) < SQ(20.0f)) {
interactionType = -1;

View file

@ -1177,8 +1177,8 @@ void func_808322FC(Player* this) {
void func_80832318(Player* this) {
this->stateFlags2 &= ~PLAYER_STATE2_17;
this->swordState = 0;
this->swordInfo[0].active = this->swordInfo[1].active = this->swordInfo[2].active = 0;
this->meleeWeaponState = 0;
this->meleeWeaponInfo[0].active = this->meleeWeaponInfo[1].active = this->meleeWeaponInfo[2].active = 0;
}
void func_80832340(GlobalContext* globalCtx, Player* this) {
@ -1772,11 +1772,11 @@ void func_8083399C(GlobalContext* globalCtx, Player* this, s8 actionParam) {
Player_SetModelGroup(this, this->modelGroup);
}
void func_80833A20(Player* this, s32 newSwordState) {
void func_80833A20(Player* this, s32 newMeleeWeaponState) {
u16 itemSfx;
u16 voiceSfx;
if (this->swordState == 0) {
if (this->meleeWeaponState == 0) {
if ((this->heldItemActionParam == PLAYER_AP_SWORD_BGS) && (gSaveContext.swordHealth > 0.0f)) {
itemSfx = NA_SE_IT_HAMMER_SWING;
} else {
@ -1786,7 +1786,7 @@ void func_80833A20(Player* this, s32 newSwordState) {
voiceSfx = NA_SE_VO_LI_SWORD_N;
if (this->heldItemActionParam == PLAYER_AP_HAMMER) {
itemSfx = NA_SE_IT_HAMMER_SWING;
} else if (this->swordAnimation >= 0x18) {
} else if (this->meleeWeaponAnimation >= 0x18) {
itemSfx = 0;
voiceSfx = NA_SE_VO_LI_SWORD_L;
} else if (this->unk_845 >= 3) {
@ -1798,12 +1798,12 @@ void func_80833A20(Player* this, s32 newSwordState) {
func_808328EC(this, itemSfx);
}
if ((this->swordAnimation < 0x10) || (this->swordAnimation >= 0x14)) {
if ((this->meleeWeaponAnimation < 0x10) || (this->meleeWeaponAnimation >= 0x14)) {
func_80832698(this, voiceSfx);
}
}
this->swordState = newSwordState;
this->meleeWeaponState = newMeleeWeaponState;
}
s32 func_80833B2C(Player* this) {
@ -2702,10 +2702,10 @@ void func_80835F44(GlobalContext* globalCtx, Player* this, s32 item) {
actionParam = Player_ItemToActionParam(item);
if (((this->heldItemActionParam == this->itemActionParam) &&
(!(this->stateFlags1 & PLAYER_STATE1_22) || (Player_ActionToSword(actionParam) != 0) ||
(!(this->stateFlags1 & PLAYER_STATE1_22) || (Player_ActionToMeleeWeapon(actionParam) != 0) ||
(actionParam == PLAYER_AP_NONE))) ||
((this->itemActionParam < 0) &&
((Player_ActionToSword(actionParam) != 0) || (actionParam == PLAYER_AP_NONE)))) {
((Player_ActionToMeleeWeapon(actionParam) != 0) || (actionParam == PLAYER_AP_NONE)))) {
if ((actionParam == PLAYER_AP_NONE) || !(this->stateFlags1 & PLAYER_STATE1_27) ||
((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) &&
@ -3211,7 +3211,7 @@ void func_80837530(GlobalContext* globalCtx, Player* this, s32 arg2) {
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_GetSwordHeld(this) | arg2);
this->bodyPartsPos[0].y, this->bodyPartsPos[0].z, 0, 0, 0, Player_GetMeleeWeaponHeld(this) | arg2);
}
}
@ -3255,7 +3255,7 @@ s32 func_808375D8(Player* this) {
void func_80837704(GlobalContext* globalCtx, Player* this) {
LinkAnimationHeader* anim;
if ((this->swordAnimation >= 4) && (this->swordAnimation < 8)) {
if ((this->meleeWeaponAnimation >= 4) && (this->meleeWeaponAnimation < 8)) {
anim = D_80854358[Player_HoldsTwoHandedWeapon(this)];
} else {
anim = D_80854350[Player_HoldsTwoHandedWeapon(this)];
@ -3317,12 +3317,12 @@ s32 func_80837818(Player* this) {
}
void func_80837918(Player* this, s32 quadIndex, u32 flags) {
this->swordQuads[quadIndex].info.toucher.dmgFlags = flags;
this->meleeWeaponQuads[quadIndex].info.toucher.dmgFlags = flags;
if (flags == 2) {
this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD;
this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST | TOUCH_SFX_WOOD;
} else {
this->swordQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST;
this->meleeWeaponQuads[quadIndex].info.toucherFlags = TOUCH_ON | TOUCH_NEAREST;
}
}
@ -3342,7 +3342,7 @@ void func_80837948(GlobalContext* globalCtx, Player* this, s32 arg2) {
func_80832318(this);
}
if ((arg2 != this->swordAnimation) || !(this->unk_845 < 3)) {
if ((arg2 != this->meleeWeaponAnimation) || !(this->unk_845 < 3)) {
this->unk_845 = 0;
}
@ -3351,7 +3351,7 @@ void func_80837948(GlobalContext* globalCtx, Player* this, s32 arg2) {
arg2 += 2;
}
this->swordAnimation = arg2;
this->meleeWeaponAnimation = arg2;
func_808322D0(globalCtx, this, D_80854190[arg2].unk_00);
if ((arg2 != 16) && (arg2 != 17)) {
@ -3363,7 +3363,7 @@ void func_80837948(GlobalContext* globalCtx, Player* this, s32 arg2) {
if (Player_HoldsBrokenKnife(this)) {
temp = 1;
} else {
temp = Player_GetSwordHeld(this) - 1;
temp = Player_GetMeleeWeaponHeld(this) - 1;
}
if ((arg2 >= 16) && (arg2 < 20)) {
@ -3711,8 +3711,8 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) {
}
if ((this->unk_A87 != 0) || (this->invincibilityTimer > 0) || (this->stateFlags1 & PLAYER_STATE1_26) ||
(this->csMode != 0) || (this->swordQuads[0].base.atFlags & AT_HIT) ||
(this->swordQuads[1].base.atFlags & AT_HIT)) {
(this->csMode != 0) || (this->meleeWeaponQuads[0].base.atFlags & AT_HIT) ||
(this->meleeWeaponQuads[1].base.atFlags & AT_HIT)) {
return 0;
}
@ -4565,7 +4565,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) {
if (!(this->stateFlags3 & PLAYER_STATE3_1) && !(this->skelAnime.moveFlags & 0x80) &&
(func_8084411C != this->func_674) && (func_80844A44 != this->func_674)) {
if ((D_80853604 == 7) || (this->swordState != 0)) {
if ((D_80853604 == 7) || (this->meleeWeaponState != 0)) {
Math_Vec3f_Copy(&this->actor.world.pos, &this->actor.prevPos);
func_80832210(this);
return;
@ -4585,7 +4585,7 @@ void func_8083AA10(Player* this, GlobalContext* globalCtx) {
this->unk_89E = this->unk_A82;
if ((this->actor.bgCheckFlags & BGCHECKFLAG_GROUND_LEAVE) && !(this->stateFlags1 & PLAYER_STATE1_27) &&
(D_80853604 != 6) && (D_80853604 != 9) && (D_80853600 > 20.0f) && (this->swordState == 0) &&
(D_80853604 != 6) && (D_80853604 != 9) && (D_80853600 > 20.0f) && (this->meleeWeaponState == 0) &&
(ABS(sp5C) < 0x2000) && (this->linearVelocity > 3.0f)) {
if ((D_80853604 == 11) && !(this->stateFlags1 & PLAYER_STATE1_11)) {
@ -4971,7 +4971,7 @@ void func_8083BA90(GlobalContext* globalCtx, Player* this, s32 arg2, f32 xzVeloc
}
s32 func_8083BB20(Player* this) {
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetSwordHeld(this) != 0)) {
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0)) {
if (D_80853614 ||
((this->actor.category != ACTORCAT_PLAYER) && CHECK_BTN_ALL(sControlInput->press.button, BTN_B))) {
return 1;
@ -5037,7 +5037,7 @@ s32 func_8083BDBC(Player* this, GlobalContext* globalCtx) {
func_8083BC04(this, globalCtx);
}
} else {
if (Player_GetSwordHeld(this) && func_808365C8(this)) {
if ((Player_GetMeleeWeaponHeld(this) != 0) && func_808365C8(this)) {
func_8083BA90(globalCtx, this, 17, 5.0f, 5.0f);
} else {
func_8083BC04(this, globalCtx);
@ -5197,7 +5197,7 @@ void func_8083C50C(Player* this) {
s32 func_8083C544(Player* this, GlobalContext* globalCtx) {
if (CHECK_BTN_ALL(sControlInput->cur.button, BTN_B)) {
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetSwordHeld(this) != 0) && (this->unk_844 == 1) &&
if (!(this->stateFlags1 & PLAYER_STATE1_22) && (Player_GetMeleeWeaponHeld(this) != 0) && (this->unk_844 == 1) &&
(this->heldItemActionParam != PLAYER_AP_STICK)) {
if ((this->heldItemActionParam != PLAYER_AP_SWORD_BGS) || (gSaveContext.swordHealth > 0.0f)) {
func_808377DC(globalCtx, this);
@ -5754,7 +5754,7 @@ void func_8083DF68(Player* this, f32 arg1, s16 arg2) {
void func_8083DFE0(Player* this, f32* arg1, s16* arg2) {
s16 yawDiff = this->currentYaw - *arg2;
if (this->swordState == 0) {
if (this->meleeWeaponState == 0) {
this->linearVelocity = CLAMP(this->linearVelocity, -(R_RUN_SPEED_LIMIT / 100.0f), (R_RUN_SPEED_LIMIT / 100.0f));
}
@ -6576,7 +6576,7 @@ void func_80840450(Player* this, GlobalContext* globalCtx) {
s32 temp4;
if (this->stateFlags3 & PLAYER_STATE3_3) {
if (Player_GetSwordHeld(this)) {
if (Player_GetMeleeWeaponHeld(this) != 0) {
this->stateFlags2 |= PLAYER_STATE2_5 | PLAYER_STATE2_6;
} else {
this->stateFlags3 &= ~PLAYER_STATE3_3;
@ -6741,7 +6741,7 @@ void func_808409CC(GlobalContext* globalCtx, Player* this) {
sp34 = Rand_ZeroOne() * 5.0f;
if (sp34 < 4) {
if (((sp34 != 0) && (sp34 != 3)) ||
((this->rightHandType == 10) && ((sp34 == 3) || Player_GetSwordHeld(this)))) {
((this->rightHandType == 10) && ((sp34 == 3) || (Player_GetMeleeWeaponHeld(this) != 0)))) {
if ((sp34 == 0) && Player_HoldsTwoHandedWeapon(this)) {
sp34 = 4;
}
@ -7417,10 +7417,10 @@ s32 func_8084285C(Player* this, f32 arg1, f32 arg2, f32 arg3) {
}
s32 func_808428D8(Player* this, GlobalContext* globalCtx) {
if (!Player_IsChildWithHylianShield(this) && Player_GetSwordHeld(this) && D_80853614) {
if (!Player_IsChildWithHylianShield(this) && (Player_GetMeleeWeaponHeld(this) != 0) && D_80853614) {
func_80832264(globalCtx, this, &gPlayerAnim_002EC8);
this->unk_84F = 1;
this->swordAnimation = 0xC;
this->meleeWeaponAnimation = 0xC;
this->currentYaw = this->actor.shape.rot.y + this->unk_6BE;
return 1;
}
@ -7527,22 +7527,24 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) {
s32 temp1;
s32 sp48;
if (this->swordState > 0) {
if (this->swordAnimation < 0x18) {
if (!(this->swordQuads[0].base.atFlags & AT_BOUNCED) && !(this->swordQuads[1].base.atFlags & AT_BOUNCED)) {
if (this->meleeWeaponState > 0) {
if (this->meleeWeaponAnimation < 0x18) {
if (!(this->meleeWeaponQuads[0].base.atFlags & AT_BOUNCED) &&
!(this->meleeWeaponQuads[1].base.atFlags & AT_BOUNCED)) {
if (this->skelAnime.curFrame >= 2.0f) {
phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->swordInfo[0].tip, &this->swordInfo[0].base, &sp50);
phi_f2 = Math_Vec3f_DistXYZAndStoreDiff(&this->meleeWeaponInfo[0].tip,
&this->meleeWeaponInfo[0].base, &sp50);
if (phi_f2 != 0.0f) {
phi_f2 = (phi_f2 + 10.0f) / phi_f2;
}
sp68.x = this->swordInfo[0].tip.x + (sp50.x * phi_f2);
sp68.y = this->swordInfo[0].tip.y + (sp50.y * phi_f2);
sp68.z = this->swordInfo[0].tip.z + (sp50.z * phi_f2);
sp68.x = this->meleeWeaponInfo[0].tip.x + (sp50.x * phi_f2);
sp68.y = this->meleeWeaponInfo[0].tip.y + (sp50.y * phi_f2);
sp68.z = this->meleeWeaponInfo[0].tip.z + (sp50.z * phi_f2);
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp68, &this->swordInfo[0].tip, &sp5C, &sp78, true,
false, false, true, &sp74) &&
if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp68, &this->meleeWeaponInfo[0].tip, &sp5C, &sp78,
true, false, false, true, &sp74) &&
!SurfaceType_IsIgnoredByEntities(&globalCtx->colCtx, sp78, sp74) &&
(func_80041D4C(&globalCtx->colCtx, sp78, sp74) != 6) &&
(func_8002F9EC(globalCtx, &this->actor, sp78, sp74, &sp5C) == 0)) {
@ -7581,11 +7583,11 @@ s32 func_80842DF4(GlobalContext* globalCtx, Player* this) {
}
}
temp1 = (this->swordQuads[0].base.atFlags & AT_HIT) || (this->swordQuads[1].base.atFlags & AT_HIT);
temp1 = (this->meleeWeaponQuads[0].base.atFlags & AT_HIT) || (this->meleeWeaponQuads[1].base.atFlags & AT_HIT);
if (temp1) {
if (this->swordAnimation < 0x18) {
Actor* at = this->swordQuads[temp1 ? 1 : 0].base.at;
if (this->meleeWeaponAnimation < 0x18) {
Actor* at = this->meleeWeaponQuads[temp1 ? 1 : 0].base.at;
if ((at != NULL) && (at->id != ACTOR_EN_KANBAN)) {
func_80832630(globalCtx);
@ -8217,8 +8219,8 @@ void func_80844AF4(Player* this, GlobalContext* globalCtx) {
}
if (func_80843E64(globalCtx, this) >= 0) {
this->swordAnimation += 2;
func_80837948(globalCtx, this, this->swordAnimation);
this->meleeWeaponAnimation += 2;
func_80837948(globalCtx, this, this->meleeWeaponAnimation);
this->unk_845 = 3;
func_808328A0(this);
}
@ -9033,7 +9035,7 @@ static Vec3s D_80854730 = { -57, 3377, 0 };
void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeader* skelHeader) {
this->ageProperties = &sAgeProperties[gSaveContext.linkAge];
Actor_ProcessInitChain(&this->actor, D_80854708);
this->swordEffectIndex = TOTAL_EFFECT_COUNT;
this->meleeWeaponEffectIndex = TOTAL_EFFECT_COUNT;
this->currentYaw = this->actor.world.rot.y;
func_80834644(globalCtx, this);
@ -9044,15 +9046,15 @@ void Player_InitCommon(Player* this, GlobalContext* globalCtx, FlexSkeletonHeade
this->morphTable2, PLAYER_LIMB_MAX);
this->skelAnime2.baseTransl = D_80854730;
Effect_Add(globalCtx, &this->swordEffectIndex, EFFECT_BLURE2, 0, 0, &D_8085470C);
Effect_Add(globalCtx, &this->meleeWeaponEffectIndex, EFFECT_BLURE2, 0, 0, &D_8085470C);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFeet, this->ageProperties->unk_04);
this->unk_46C = SUBCAM_NONE;
Collider_InitCylinder(globalCtx, &this->cylinder);
Collider_SetCylinder(globalCtx, &this->cylinder, &this->actor, &D_80854624);
Collider_InitQuad(globalCtx, &this->swordQuads[0]);
Collider_SetQuad(globalCtx, &this->swordQuads[0], &this->actor, &D_80854650);
Collider_InitQuad(globalCtx, &this->swordQuads[1]);
Collider_SetQuad(globalCtx, &this->swordQuads[1], &this->actor, &D_80854650);
Collider_InitQuad(globalCtx, &this->meleeWeaponQuads[0]);
Collider_SetQuad(globalCtx, &this->meleeWeaponQuads[0], &this->actor, &D_80854650);
Collider_InitQuad(globalCtx, &this->meleeWeaponQuads[1]);
Collider_SetQuad(globalCtx, &this->meleeWeaponQuads[1], &this->actor, &D_80854650);
Collider_InitQuad(globalCtx, &this->shieldQuad);
Collider_SetQuad(globalCtx, &this->shieldQuad, &this->actor, &D_808546A0);
}
@ -9715,7 +9717,8 @@ void Player_UpdateCamAndSeqModes(GlobalContext* globalCtx, Player* this) {
}
} else if (this->stateFlags1 & PLAYER_STATE1_19) {
camMode = CAM_MODE_FREEFALL;
} else if ((this->swordState != 0) && (this->swordAnimation >= 0) && (this->swordAnimation < 0x18)) {
} else if ((this->meleeWeaponState != 0) && (this->meleeWeaponAnimation >= 0) &&
(this->meleeWeaponAnimation < 0x18)) {
camMode = CAM_MODE_STILL;
} else {
camMode = CAM_MODE_NORMAL;
@ -9770,8 +9773,8 @@ void func_80848A04(GlobalContext* globalCtx, Player* this) {
this->unk_85C = temp;
}
func_8002836C(globalCtx, &this->swordInfo[0].tip, &D_808547A4, &D_808547B0, &D_808547BC, &D_808547C0, temp * 200.0f,
0, 8);
func_8002836C(globalCtx, &this->meleeWeaponInfo[0].tip, &D_808547A4, &D_808547B0, &D_808547BC, &D_808547C0,
temp * 200.0f, 0, 8);
}
void func_80848B44(GlobalContext* globalCtx, Player* this) {
@ -10283,8 +10286,8 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) {
Collider_ResetCylinderAC(globalCtx, &this->cylinder.base);
Collider_ResetQuadAT(globalCtx, &this->swordQuads[0].base);
Collider_ResetQuadAT(globalCtx, &this->swordQuads[1].base);
Collider_ResetQuadAT(globalCtx, &this->meleeWeaponQuads[0].base);
Collider_ResetQuadAT(globalCtx, &this->meleeWeaponQuads[1].base);
Collider_ResetQuadAC(globalCtx, &this->shieldQuad.base);
Collider_ResetQuadAT(globalCtx, &this->shieldQuad.base);
@ -10528,11 +10531,11 @@ void Player_Draw(Actor* thisx, GlobalContext* globalCtx2) {
void Player_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Player* this = (Player*)thisx;
Effect_Delete(globalCtx, this->swordEffectIndex);
Effect_Delete(globalCtx, this->meleeWeaponEffectIndex);
Collider_DestroyCylinder(globalCtx, &this->cylinder);
Collider_DestroyQuad(globalCtx, &this->swordQuads[0]);
Collider_DestroyQuad(globalCtx, &this->swordQuads[1]);
Collider_DestroyQuad(globalCtx, &this->meleeWeaponQuads[0]);
Collider_DestroyQuad(globalCtx, &this->meleeWeaponQuads[1]);
Collider_DestroyQuad(globalCtx, &this->shieldQuad);
func_800876C8(globalCtx);
@ -12709,7 +12712,7 @@ s32 func_80850224(Player* this, GlobalContext* globalCtx) {
static Vec3f D_80854A40 = { 0.0f, 40.0f, 45.0f };
void func_808502D0(Player* this, GlobalContext* globalCtx) {
struct_80854190* sp44 = &D_80854190[this->swordAnimation];
struct_80854190* sp44 = &D_80854190[this->meleeWeaponAnimation];
this->stateFlags2 |= PLAYER_STATE2_5;
@ -12753,7 +12756,7 @@ void func_808502D0(Player* this, GlobalContext* globalCtx) {
this->stateFlags3 |= PLAYER_STATE3_3;
}
} else if (this->heldItemActionParam == PLAYER_AP_HAMMER) {
if ((this->swordAnimation == 0x16) || (this->swordAnimation == 0x13)) {
if ((this->meleeWeaponAnimation == 0x16) || (this->meleeWeaponAnimation == 0x13)) {
static Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
Vec3f shockwavePos;
f32 sp2C;
@ -12764,8 +12767,8 @@ void func_808502D0(Player* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.focus.rot.x, Math_Atan2S(45.0f, sp2C), 800);
func_80836AB8(this, 1);
if ((((this->swordAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) ||
((this->swordAnimation == 0x13) && LinkAnimation_OnFrame(&this->skelAnime, 2.0f))) &&
if ((((this->meleeWeaponAnimation == 0x16) && LinkAnimation_OnFrame(&this->skelAnime, 7.0f)) ||
((this->meleeWeaponAnimation == 0x13) && LinkAnimation_OnFrame(&this->skelAnime, 2.0f))) &&
(sp2C > -40.0f) && (sp2C < 40.0f)) {
func_80842A28(globalCtx, this);
EffectSsBlast_SpawnWhiteShockwave(globalCtx, &shockwavePos, &zeroVec, &zeroVec);