[docs] Upstream updates 1 (#1955)
* First round of upstream updates and commenting patternss * Renames from z64player * Renames from z64save * Undo changes to legacy save struct * Add missing reference from entrance rando * Fixes from stat tracker * More tweaks
This commit is contained in:
@@ -332,7 +332,7 @@ void Player_SetBootData(PlayState* play, Player* this) {
|
||||
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
|
||||
return (this->stateFlags1 & 0x20000080) || (this->csMode != 0) || (play->sceneLoadFlag == 0x14) ||
|
||||
(this->stateFlags1 & 1) || (this->stateFlags3 & 0x80) ||
|
||||
((gSaveContext.unk_13F0 != 0) && (Player_ActionToMagicSpell(this, this->itemActionParam) >= 0));
|
||||
((gSaveContext.magicState != 0) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0));
|
||||
}
|
||||
|
||||
s32 Player_InCsMode(PlayState* play) {
|
||||
@@ -361,8 +361,8 @@ s32 Player_ActionToModelGroup(Player* this, s32 actionParam) {
|
||||
|
||||
void Player_SetModelsForHoldingShield(Player* this) {
|
||||
if ((this->stateFlags1 & 0x400000) &&
|
||||
((this->itemActionParam < 0) || (this->itemActionParam == this->heldItemActionParam))) {
|
||||
if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemActionParam != PLAYER_AP_STICK) ||
|
||||
((this->itemAction < 0) || (this->itemAction == this->heldItemAction))) {
|
||||
if ((CVar_GetS32("gShieldTwoHanded", 0) && (this->heldItemAction != PLAYER_IA_STICK) ||
|
||||
!Player_HoldsTwoHandedWeapon(this)) && !Player_IsChildWithHylianShield(this)) {
|
||||
this->rightHandType = 10;
|
||||
this->rightHandDLists = &sPlayerDListGroups[10][gSaveContext.linkAge];
|
||||
@@ -373,7 +373,7 @@ void Player_SetModelsForHoldingShield(Player* this) {
|
||||
}
|
||||
this->sheathDLists = &sPlayerDListGroups[this->sheathType][gSaveContext.linkAge];
|
||||
this->modelAnimType = 2;
|
||||
this->itemActionParam = -1;
|
||||
this->itemAction = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -408,8 +408,8 @@ void Player_SetModelGroup(Player* this, s32 modelGroup) {
|
||||
}
|
||||
|
||||
void func_8008EC70(Player* this) {
|
||||
this->itemActionParam = this->heldItemActionParam;
|
||||
Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemActionParam));
|
||||
this->itemAction = this->heldItemAction;
|
||||
Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemAction));
|
||||
this->unk_6AD = 0;
|
||||
}
|
||||
|
||||
@@ -418,8 +418,8 @@ void Player_SetEquipmentData(PlayState* play, Player* this) {
|
||||
this->currentShield = CUR_EQUIP_VALUE(EQUIP_SHIELD);
|
||||
this->currentTunic = CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1;
|
||||
this->currentBoots = CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1;
|
||||
this->currentSwordItem = B_BTN_ITEM;
|
||||
Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemActionParam));
|
||||
this->currentSwordItemId = B_BTN_ITEM;
|
||||
Player_SetModelGroup(this, Player_ActionToModelGroup(this, this->heldItemAction));
|
||||
Player_SetBootData(play, this);
|
||||
}
|
||||
}
|
||||
@@ -429,10 +429,10 @@ void Player_UpdateBottleHeld(PlayState* play, Player* this, s32 item, s32 action
|
||||
|
||||
if (item != ITEM_BOTTLE) {
|
||||
this->heldItemId = item;
|
||||
this->heldItemActionParam = actionParam;
|
||||
this->heldItemAction = actionParam;
|
||||
}
|
||||
|
||||
this->itemActionParam = actionParam;
|
||||
this->itemAction = actionParam;
|
||||
}
|
||||
|
||||
void func_8008EDF0(Player* this) {
|
||||
@@ -478,8 +478,8 @@ s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 y
|
||||
Vec3f diff;
|
||||
s32 pad;
|
||||
|
||||
if ((this->heldItemActionParam == PLAYER_AP_STICK) && (this->unk_860 != 0)) {
|
||||
Math_Vec3f_Diff(&this->swordInfo[0].tip, pos, &diff);
|
||||
if ((this->heldItemAction == PLAYER_IA_STICK) && (this->unk_860 != 0)) {
|
||||
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;
|
||||
@@ -525,7 +525,7 @@ s32 Player_HasMirrorShieldSetToDraw(PlayState* play) {
|
||||
}
|
||||
|
||||
s32 Player_ActionToMagicSpell(Player* this, s32 actionParam) {
|
||||
s32 magicSpell = actionParam - PLAYER_AP_MAGIC_SPELL_15;
|
||||
s32 magicSpell = actionParam - PLAYER_IA_MAGIC_SPELL_15;
|
||||
|
||||
if ((magicSpell >= 0) && (magicSpell < 6)) {
|
||||
return magicSpell;
|
||||
@@ -535,7 +535,7 @@ s32 Player_ActionToMagicSpell(Player* this, s32 actionParam) {
|
||||
}
|
||||
|
||||
s32 Player_HoldsHookshot(Player* this) {
|
||||
return (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) || (this->heldItemActionParam == PLAYER_AP_LONGSHOT);
|
||||
return (this->heldItemAction == PLAYER_IA_HOOKSHOT) || (this->heldItemAction == PLAYER_IA_LONGSHOT);
|
||||
}
|
||||
|
||||
s32 func_8008F128(Player* this) {
|
||||
@@ -543,7 +543,7 @@ s32 func_8008F128(Player* this) {
|
||||
}
|
||||
|
||||
s32 Player_ActionToSword(s32 actionParam) {
|
||||
s32 sword = actionParam - PLAYER_AP_FISHING_POLE;
|
||||
s32 sword = actionParam - PLAYER_IA_FISHING_POLE;
|
||||
|
||||
if ((sword > 0) && (sword < 6)) {
|
||||
return sword;
|
||||
@@ -553,11 +553,11 @@ s32 Player_ActionToSword(s32 actionParam) {
|
||||
}
|
||||
|
||||
s32 Player_GetSwordHeld(Player* this) {
|
||||
return Player_ActionToSword(this->heldItemActionParam);
|
||||
return Player_ActionToSword(this->heldItemAction);
|
||||
}
|
||||
|
||||
s32 Player_HoldsTwoHandedWeapon(Player* this) {
|
||||
if ((this->heldItemActionParam >= PLAYER_AP_SWORD_BGS) && (this->heldItemActionParam <= PLAYER_AP_HAMMER)) {
|
||||
if ((this->heldItemAction >= PLAYER_IA_SWORD_BGS) && (this->heldItemAction <= PLAYER_IA_HAMMER)) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
@@ -565,11 +565,11 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) {
|
||||
}
|
||||
|
||||
s32 Player_HoldsBrokenKnife(Player* this) {
|
||||
return (this->heldItemActionParam == PLAYER_AP_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f);
|
||||
return (this->heldItemAction == PLAYER_IA_SWORD_BGS) && (gSaveContext.swordHealth <= 0.0f);
|
||||
}
|
||||
|
||||
s32 Player_ActionToBottle(Player* this, s32 actionParam) {
|
||||
s32 bottle = actionParam - PLAYER_AP_BOTTLE;
|
||||
s32 bottle = actionParam - PLAYER_IA_BOTTLE;
|
||||
|
||||
if ((bottle >= 0) && (bottle < 13)) {
|
||||
return bottle;
|
||||
@@ -579,11 +579,11 @@ s32 Player_ActionToBottle(Player* this, s32 actionParam) {
|
||||
}
|
||||
|
||||
s32 Player_GetBottleHeld(Player* this) {
|
||||
return Player_ActionToBottle(this, this->heldItemActionParam);
|
||||
return Player_ActionToBottle(this, this->heldItemAction);
|
||||
}
|
||||
|
||||
s32 Player_ActionToExplosive(Player* this, s32 actionParam) {
|
||||
s32 explosive = actionParam - PLAYER_AP_BOMB;
|
||||
s32 explosive = actionParam - PLAYER_IA_BOMB;
|
||||
|
||||
if ((explosive >= 0) && (explosive < 2)) {
|
||||
return explosive;
|
||||
@@ -593,14 +593,14 @@ s32 Player_ActionToExplosive(Player* this, s32 actionParam) {
|
||||
}
|
||||
|
||||
s32 Player_GetExplosiveHeld(Player* this) {
|
||||
return Player_ActionToExplosive(this, this->heldItemActionParam);
|
||||
return Player_ActionToExplosive(this, this->heldItemAction);
|
||||
}
|
||||
|
||||
s32 func_8008F2BC(Player* this, s32 actionParam) {
|
||||
s32 sword = 0;
|
||||
|
||||
if (actionParam != PLAYER_AP_LAST_USED) {
|
||||
sword = actionParam - PLAYER_AP_SWORD_MASTER;
|
||||
if (actionParam != PLAYER_IA_LAST_USED) {
|
||||
sword = actionParam - PLAYER_IA_SWORD_MASTER;
|
||||
if ((sword < 0) || (sword >= 3)) {
|
||||
goto return_neg;
|
||||
}
|
||||
@@ -857,7 +857,7 @@ void func_8008F87C(PlayState* play, Player* this, SkelAnime* skelAnime, Vec3f* p
|
||||
s32 temp3;
|
||||
|
||||
if ((this->actor.scale.y >= 0.0f) && !(this->stateFlags1 & 0x80) &&
|
||||
(Player_ActionToMagicSpell(this, this->itemActionParam) < 0)) {
|
||||
(Player_ActionToMagicSpell(this, this->itemAction) < 0)) {
|
||||
s32 pad;
|
||||
|
||||
sp7C = D_80126058[gSaveContext.linkAge];
|
||||
@@ -931,7 +931,7 @@ s32 func_8008FCC8(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s
|
||||
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)) {
|
||||
@@ -1157,15 +1157,15 @@ void func_800906D4(PlayState* play, Player* this, Vec3f* newTipPos) {
|
||||
Matrix_MultVec3f(&D_801260A4[1], &newBasePos[1]);
|
||||
Matrix_MultVec3f(&D_801260A4[2], &newBasePos[2]);
|
||||
|
||||
if (func_80090480(play, NULL, &this->swordInfo[0], &newTipPos[0], &newBasePos[0]) &&
|
||||
if (func_80090480(play, NULL, &this->meleeWeaponInfo[0], &newTipPos[0], &newBasePos[0]) &&
|
||||
!(this->stateFlags1 & 0x400000)) {
|
||||
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 & 0x20000))) {
|
||||
func_80090480(play, &this->swordQuads[0], &this->swordInfo[1], &newTipPos[1], &newBasePos[1]);
|
||||
func_80090480(play, &this->swordQuads[1], &this->swordInfo[2], &newTipPos[2], &newBasePos[2]);
|
||||
if ((this->swordState > 0) && ((this->meleeWeaponAnimation < 0x18) || (this->stateFlags2 & 0x20000))) {
|
||||
func_80090480(play, &this->meleeWeaponQuads[0], &this->meleeWeaponInfo[1], &newTipPos[1], &newBasePos[1]);
|
||||
func_80090480(play, &this->meleeWeaponQuads[1], &this->meleeWeaponInfo[2], &newTipPos[2], &newBasePos[2]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1321,7 +1321,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
|
||||
|
||||
Math_Vec3f_Copy(&this->leftHandPos, D_80160000);
|
||||
|
||||
if (this->itemActionParam == PLAYER_AP_STICK) {
|
||||
if (this->itemAction == PLAYER_IA_STICK) {
|
||||
Vec3f sp124[3];
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
@@ -1330,10 +1330,10 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
|
||||
D_80126080.x = this->unk_85C * 5000.0f;
|
||||
func_80090A28(this, sp124);
|
||||
if (this->swordState != 0) {
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex), 7); // default sword type
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), 7); // default sword type
|
||||
func_800906D4(play, this, sp124);
|
||||
} else {
|
||||
Math_Vec3f_Copy(&this->swordInfo[0].tip, &sp124[0]);
|
||||
Math_Vec3f_Copy(&this->meleeWeaponInfo[0].tip, &sp124[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,15 +1354,15 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
|
||||
} else {
|
||||
D_80126080.x = sSwordLengths[Player_GetSwordHeld(this)];
|
||||
if (CVar_GetS32("gSeperateSwords", 0) != 0)
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex), sSwordTypes[Player_GetSwordHeld(this)]);
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex), sSwordTypes[Player_GetSwordHeld(this)]);
|
||||
else
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->swordEffectIndex),1); //default sword type
|
||||
EffectBlure_ChangeType(Effect_GetByIndex(this->meleeWeaponEffectIndex),1); //default sword type
|
||||
}
|
||||
|
||||
func_80090A28(this, spE4);
|
||||
func_800906D4(play, this, spE4);
|
||||
} else if ((*dList != NULL) && (this->leftHandType == 7)) {
|
||||
Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemActionParam)];
|
||||
Color_RGB8* bottleColor = &sBottleColors[Player_ActionToBottle(this, this->itemAction)];
|
||||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
@@ -1451,8 +1451,8 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
|
||||
}
|
||||
|
||||
if (this->actor.scale.y >= 0.0f) {
|
||||
if ((this->heldItemActionParam == PLAYER_AP_HOOKSHOT) ||
|
||||
(this->heldItemActionParam == PLAYER_AP_LONGSHOT)) {
|
||||
if ((this->heldItemAction == PLAYER_IA_HOOKSHOT) ||
|
||||
(this->heldItemAction == PLAYER_IA_LONGSHOT)) {
|
||||
Matrix_MultVec3f(&D_80126184, &this->unk_3C8);
|
||||
|
||||
if (heldActor != NULL) {
|
||||
@@ -1468,7 +1468,7 @@ void func_80090D20(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void
|
||||
if (func_8002DD78(this) != 0) {
|
||||
Matrix_Translate(500.0f, 300.0f, 0.0f, MTXMODE_APPLY);
|
||||
Player_DrawHookshotReticle(
|
||||
play, this, (this->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 38600.0f : 77600.0f);
|
||||
play, this, (this->heldItemAction == PLAYER_IA_HOOKSHOT) ? 38600.0f : 77600.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user