1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-12 10:54:44 +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

@ -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);