[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:
Garrett Cox 2022-11-29 17:28:57 -06:00 committed by GitHub
commit d7c3522142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 1721 additions and 1040 deletions

View file

@ -85,7 +85,7 @@ void ArmsHook_Wait(ArmsHook* this, PlayState* play) {
if (this->actor.parent == NULL) {
Player* player = GET_PLAYER(play);
// get correct timer length for hookshot or longshot
s32 length = (player->heldItemActionParam == PLAYER_AP_HOOKSHOT) ? 13 : 26;
s32 length = (player->heldItemAction == PLAYER_IA_HOOKSHOT) ? 13 : 26;
ArmsHook_SetupAction(this, ArmsHook_Shoot);
func_8002D9A4(&this->actor, 20.0f);
@ -121,7 +121,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
Player* player = (Player*)this->actor.parent;
if (Player_HoldsHookshot(player)) {
if ((player->itemActionParam != player->heldItemActionParam) || (player->actor.flags & ACTOR_FLAG_8) ||
if ((player->itemAction != player->heldItemAction) || (player->actor.flags & ACTOR_FLAG_8) ||
((player->stateFlags1 & 0x4000080))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);

View file

@ -209,12 +209,12 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) {
}
if (play->sceneNum == SCENE_DAIYOUSEI_IZUMI) {
if (!gSaveContext.magicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) {
if (!gSaveContext.isMagicAcquired && (this->fountainType != FAIRY_UPGRADE_MAGIC)) {
Actor_Kill(&this->actor);
return;
}
} else {
if (!gSaveContext.magicAcquired) {
if (!gSaveContext.isMagicAcquired) {
Actor_Kill(&this->actor);
return;
}
@ -253,7 +253,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
} else {
switch (this->fountainType) {
case FAIRY_UPGRADE_MAGIC:
if (!gSaveContext.magicAcquired || BREG(2)) {
if (!gSaveContext.isMagicAcquired || BREG(2)) {
// "Spin Attack speed UP"
osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 回転切り速度UP ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -261,7 +261,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
}
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.doubleMagic) {
if (!gSaveContext.isDoubleMagicAcquired) {
// "Magic Meter doubled"
osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 魔法ゲージメーター倍増 ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -269,7 +269,7 @@ void BgDyYoseizo_ChooseType(BgDyYoseizo* this, PlayState* play) {
}
break;
case FAIRY_UPGRADE_HALF_DAMAGE:
if (!gSaveContext.doubleDefense) {
if (!gSaveContext.isDoubleDefenseAcquired) {
// "Damage halved"
osSyncPrintf(VT_FGCOL(PURPLE) " ☆☆☆☆☆ ダメージ半減 ☆☆☆☆☆ \n" VT_RST);
this->givingSpell = true;
@ -495,7 +495,7 @@ void BgDyYoseizo_HealPlayer_NoReward(BgDyYoseizo* this, PlayState* play) {
this->refillTimer = 200;
}
if (((gSaveContext.healthCapacity == gSaveContext.health) && (gSaveContext.magic == gSaveContext.unk_13F4)) ||
if (((gSaveContext.healthCapacity == gSaveContext.health) && (gSaveContext.magic == gSaveContext.magicCapacity)) ||
(this->refillTimer == 1)) {
this->healingTimer--;
if (this->healingTimer == 90) {
@ -738,21 +738,21 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
switch (actionIndex) {
case FAIRY_UPGRADE_MAGIC:
gSaveContext.magicAcquired = true;
gSaveContext.unk_13F6 = 0x30;
gSaveContext.isMagicAcquired = true;
gSaveContext.magicFillTarget = 0x30;
Interface_ChangeAlpha(9);
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
if (!gSaveContext.magicAcquired) {
gSaveContext.magicAcquired = true;
if (!gSaveContext.isMagicAcquired) {
gSaveContext.isMagicAcquired = true;
}
gSaveContext.doubleMagic = true;
gSaveContext.unk_13F6 = 0x60;
gSaveContext.isDoubleMagicAcquired = true;
gSaveContext.magicFillTarget = 0x60;
gSaveContext.magicLevel = 0;
Interface_ChangeAlpha(9);
break;
case FAIRY_UPGRADE_HALF_DAMAGE:
gSaveContext.doubleDefense = true;
gSaveContext.isDoubleDefenseAcquired = true;
Interface_ChangeAlpha(9);
break;
}
@ -780,8 +780,8 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
itemPos.x, itemPos.y, itemPos.z, 0, 0, 0, sExItemTypes[actionIndex]);
if (this->item != NULL) {
if (gSaveContext.magicAcquired == 0) {
gSaveContext.magicAcquired = 1;
if (gSaveContext.isMagicAcquired == 0) {
gSaveContext.isMagicAcquired = 1;
} else {
Magic_Fill(play);
}

View file

@ -127,7 +127,7 @@ void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) &&
(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

@ -89,7 +89,7 @@ void BgTokiSwd_Init(Actor* thisx, PlayState* play) {
uint32_t kokiriSwordBitMask = 1 << 0;
if (!(gSaveContext.inventory.equipment & kokiriSwordBitMask)) {
Player* player = GET_PLAYER(gPlayState);
player->currentSwordItem = ITEM_NONE;
player->currentSwordItemId = ITEM_NONE;
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
}

View file

@ -282,8 +282,8 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
webPos.y = this->dyna.actor.world.pos.y - 50.0f;
webPos.z = this->dyna.actor.world.pos.z;
if (Player_IsBurningStickInRange(play, &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, play);
return;
}
@ -402,11 +402,11 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) {
if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->trisCollider.base.acFlags & 2)) {
this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f;
BgYdanSp_BurnWeb(this, play);
} else if (player->heldItemActionParam == PLAYER_AP_STICK && player->unk_860 != 0) {
func_8002DBD0(&this->dyna.actor, &sp30, &player->swordInfo[0].tip);
} else if (player->heldItemAction == PLAYER_IA_STICK && player->unk_860 != 0) {
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(play, 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, play);
}
}

View file

@ -1188,7 +1188,7 @@ void BossGanon_SetupTowerCutscene(BossGanon* this, PlayState* play) {
this->csTimer = 0;
this->csState = 100;
this->unk_198 = 1;
gSaveContext.magic = gSaveContext.unk_13F4;
gSaveContext.magic = gSaveContext.magicCapacity;
gSaveContext.health = gSaveContext.healthCapacity;
} else {
this->actionFunc = BossGanon_SetupTowerCutscene;
@ -3962,7 +3962,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
switch (this->unk_1C2) {
case 0:
if ((player->stateFlags1 & 2) &&
if ((player->stateFlags1 & PLAYER_STATE1_SWINGING_BOTTLE) &&
(ABS((s16)(player->actor.shape.rot.y - (s16)(ganondorf->actor.yawTowardsPlayer + 0x8000))) <
0x2000) &&
(sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f)) {
@ -4003,7 +4003,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
}
// if a spin attack is used
if (player->swordAnimation >= 0x18) {
if (player->meleeWeaponAnimation >= 0x18) {
this->actor.speedXZ = 20.0f;
}
break;
@ -4447,7 +4447,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
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->swordState != 0) && (player->meleeWeaponAnimation >= 0x18) && (this->actor.xzDistToPlayer < 80.0f)) {
this->unk_1C2 = 0xC;
this->actor.speedXZ = -30.0f;
func_8002D908(&this->actor);

View file

@ -1668,7 +1668,7 @@ void func_8090120C(BossGanon2* this, PlayState* play) {
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->swordState != 0) && (player->heldItemAction == PLAYER_IA_SWORD_MASTER)) {
func_80064520(play, &play->csCtx);
gSaveContext.sohStats.gameComplete = true;
gSaveContext.sohStats.timestamp[TIMESTAMP_DEFEAT_GANON] = GAMEPLAYSTAT_TOTAL_TIME;

View file

@ -915,7 +915,7 @@ void GivePlayerRandoRewardImpa(Actor* impa, PlayState* play, RandomizerCheck che
gSaveContext.eventChkInf[5] |= 0x200;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
// In entrance rando have impa bring link back to the front of castle grounds
if (Randomizer_GetSettingValue(RSK_SHUFFLE_OVERWORLD_ENTRANCES)) {
play->nextEntranceIndex = 0x0138;

View file

@ -417,7 +417,7 @@ void func_80996C60(DoorShutter* this, PlayState* play) {
DoorShutter_SetupAction(this, func_80997004);
this->unk_16C = sp38;
this->unk_170 = 0.0f;
Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->unk_46A, 0.0f, 12, sp34, 10);
Camera_ChangeDoorCam(play->cameraPtrs[MAIN_CAM], &this->dyna.actor, player->doorBgCamIndex, 0.0f, 12, sp34, 10);
}
}

View file

@ -589,7 +589,7 @@ void DoorWarp1_ChildWarpOut(DoorWarp1* this, PlayState* play) {
osSyncPrintf("\n\n\nおわりおわり");
play->sceneLoadFlag = 0x14;
play->fadeTransition = 7;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
}
Math_StepToF(&this->unk_194, 2.0f, 0.01f);
@ -907,7 +907,7 @@ void DoorWarp1_AdultWarpOut(DoorWarp1* this, PlayState* play) {
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 7;
gSaveContext.nextTransitionType = 7;
}
if (this->warpTimer >= 141) {
f32 screenFillAlpha;

View file

@ -270,7 +270,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) {
EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]);
}
if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == PLAYER_AP_STICK) &&
if (((this->actor.params & 1) == 1) && (player->heldItemAction == PLAYER_IA_STICK) &&
(this->swordDownTimer <= 0) &&
((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z) < SQ(120.0f)) ||
@ -306,9 +306,9 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
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) {
@ -320,7 +320,7 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
}
}
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);
@ -336,11 +336,11 @@ void EnButte_FollowLink(EnButte* this, PlayState* play) {
distSqFromHome = Math3D_Dist2DSq(this->actor.world.pos.x, this->actor.world.pos.z, this->actor.home.pos.x,
this->actor.home.pos.z);
if (!((player->heldItemActionParam == PLAYER_AP_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) &&
if (!((player->heldItemAction == PLAYER_IA_STICK) && (fabsf(player->actor.speedXZ) < 1.8f) &&
(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);

View file

@ -470,7 +470,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
switch (this->work[FHGFIRE_FIRE_MODE]) {
case FHGFIRE_LIGHT_GREEN:
canBottleReflect1 =
((player->stateFlags1 & 2) &&
((player->stateFlags1 & PLAYER_STATE1_SWINGING_BOTTLE) &&
(ABS((s16)(player->actor.shape.rot.y - (s16)(bossGnd->actor.yawTowardsPlayer + 0x8000))) <
0x2000) &&
(sqrtf(SQ(dxL) + SQ(dyL) + SQ(dzL)) <= 25.0f))
@ -510,7 +510,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) {
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

@ -320,7 +320,7 @@ void func_80A2F9C0(EnGb* this, PlayState* play) {
gSaveContext.infTable[0xB] |= 0x40;
}
func_80A2F180(this);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Rupees_ChangeBy(10);
this->actionFunc = func_80A2F83C;
}
@ -332,7 +332,7 @@ void func_80A2FA50(EnGb* this, PlayState* play) {
gSaveContext.infTable[0xB] |= 0x40;
}
func_80A2F180(this);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
Rupees_ChangeBy(50);
HIGH_SCORE(HS_POE_POINTS) += 100;
if (HIGH_SCORE(HS_POE_POINTS) != 1000) {

View file

@ -283,7 +283,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) {
angleToLink = ABS(angleToLink);
if (func_800354B4(play, thisx, 100.0f, 0x2710, 0x3E80, thisx->shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, play);
return true;
} else if (play->gameplayFrames & 1) {
@ -296,7 +296,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) {
if ((thisx->bgCheckFlags & 8) && (ABS(angleToWall) < 0x2EE0) && (thisx->xzDistToPlayer < 90.0f)) {
EnGeldB_SetupJump(this);
return true;
} else if (player->swordAnimation == 0x11) {
} else if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, play);
return true;
} else if ((thisx->xzDistToPlayer < 90.0f) && (play->gameplayFrames & 1)) {
@ -1138,7 +1138,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) {
if ((ABS(angleToLink) <= 0x4000) && (this->actor.xzDistToPlayer < 40.0f) &&
(ABS(this->actor.yDistToPlayer) < 50.0f)) {
if (func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, play);
} else if (play->gameplayFrames & 1) {
EnGeldB_SetupBlock(this);
@ -1159,7 +1159,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) {
}
} else if ((this->timer == 0) &&
func_800354B4(play, &this->actor, 100.0f, 0x2710, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnGeldB_SetupSpinDodge(this, play);
} else if (!EnGeldB_DodgeRanged(play, this)) {
if ((play->gameplayFrames & 1)) {

View file

@ -368,7 +368,7 @@ void EnHeishi1_Kick(EnHeishi1* this, PlayState* play) {
this->loadStarted = true;
sHeishi1PlayerIsCaught = false;
play->fadeTransition = 0x2E;
gSaveContext.nextTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
}
}
}

View file

@ -208,7 +208,7 @@ void func_80A55D00(EnHeishi3* this, PlayState* play) {
play->sceneLoadFlag = 0x14;
this->respawnFlag = 1;
play->fadeTransition = 0x2E;
gSaveContext.nextTransition = 0x2E;
gSaveContext.nextTransitionType = 0x2E;
}
}

View file

@ -596,7 +596,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) {
case 0x70F3:
Rupees_ChangeBy(beggarRewards[this->actor.textId - 0x70F0]);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENHY_ANIM_17);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_AP_BOTTLE);
Player_UpdateBottleHeld(play, GET_PLAYER(play), ITEM_BOTTLE, PLAYER_IA_BOTTLE);
break;
case 0x7016:
gSaveContext.infTable[12] |= 1;

View file

@ -180,13 +180,13 @@ void func_80A8F660(EnKakasi* this, PlayState* play) {
this->unk_196 = TEXT_STATE_DONE;
if (!LINK_IS_ADULT) {
this->unk_194 = false;
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
this->actor.textId = 0x407A;
this->unk_196 = TEXT_STATE_EVENT;
}
} else {
this->unk_194 = true;
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
this->actor.textId = 0x4079;
this->unk_196 = TEXT_STATE_EVENT;
}
@ -342,7 +342,7 @@ void EnKakasi_Draw(Actor* thisx, PlayState* play) {
if (BREG(3) != 0) {
osSyncPrintf("\n\n");
// "flag!"
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowCustomSongSet);
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ フラグ! ☆☆☆☆☆ %d\n" VT_RST, gSaveContext.scarecrowLongSongSet);
}
func_80093D18(play->state.gfxCtx);
SkelAnime_DrawFlexOpa(play, this->skelanime.skeleton, this->skelanime.jointTable, this->skelanime.dListCount,

View file

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

View file

@ -85,7 +85,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
this->unk_1CA = 0;
if (player->stateFlags2 & 0x20000) {
if (!gSaveContext.magicAcquired || gSaveContext.unk_13F0 ||
if (!gSaveContext.isMagicAcquired || gSaveContext.magicState ||
(((this->actor.params & 0xFF00) >> 8) &&
!(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 0)))) {
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
@ -132,7 +132,7 @@ void func_80A9F350(EnMThunder* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (player->stateFlags2 & 0x20000) {
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,
@ -158,7 +158,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
if (this->unk_1CA == 0) {
if (player->unk_858 >= 0.1f) {
if ((gSaveContext.unk_13F0) || (((this->actor.params & 0xFF00) >> 8) &&
if ((gSaveContext.magicState) || (((this->actor.params & 0xFF00) >> 8) &&
!(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 4)))) {
func_80A9F350(this, play);
func_80A9EFE0(this, func_80A9F350);
@ -182,7 +182,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
}
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,
@ -193,7 +193,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
} else {
player->stateFlags2 &= ~0x20000;
if ((this->actor.params & 0xFF00) >> 8) {
gSaveContext.unk_13F0 = 1;
gSaveContext.magicState = 1;
}
if (player->unk_858 < 0.85f) {
this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7];

View file

@ -109,8 +109,8 @@ void EnMag_InitMq(Actor* thisx, PlayState* play) {
gSaveContext.unk_13E7 = 0;
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
Font_LoadOrderedFont(&this->font);
@ -199,8 +199,8 @@ void EnMag_InitVanilla(Actor* thisx, PlayState* play) {
gSaveContext.unk_13E7 = 0;
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
Font_LoadOrderedFont(&this->font);
@ -242,8 +242,8 @@ void EnMag_UpdateMq(Actor* thisx, PlayState* play) {
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
} else if (this->globalState >= MAG_STATE_DISPLAY) {
if (sDelayTimer == 0) {
@ -413,8 +413,8 @@ void EnMag_UpdateVanilla(Actor* thisx, PlayState* play) {
this->globalState = MAG_STATE_DISPLAY;
sDelayTimer = 20;
gSaveContext.fadeDuration = 1;
gSaveContext.unk_1419 = 255;
gSaveContext.transFadeDuration = 1;
gSaveContext.transWipeSpeed = 255;
}
} else if (this->globalState >= MAG_STATE_DISPLAY) {
if (sDelayTimer == 0) {

View file

@ -630,7 +630,7 @@ void func_80ACB274(EnOwl* this, PlayState* play) {
void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) {
EnOwl_LookAtLink(this, play);
if (!gSaveContext.magicAcquired && !gSaveContext.n64ddFlag) {
if (!gSaveContext.isMagicAcquired && !gSaveContext.n64ddFlag) {
if (func_80ACA558(this, play, 0x3062)) {
Audio_PlayFanfare(NA_BGM_OWL);
this->actionFunc = func_80ACB274;

View file

@ -349,7 +349,7 @@ void func_80AD97C8(EnPoSisters* this, PlayState* play) {
f32 sp20;
if (this->unk_195 == 0 || this->actionFunc != func_80ADAAA4) {
if ((player->swordState == 0 || player->swordAnimation >= 24) &&
if ((player->swordState == 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, PlayState* play) {
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, play);
this->unk_283 = 1;
}

View file

@ -732,7 +732,7 @@ s32 func_80B0DFFC(EnSw* this, PlayState* play) {
false, false, true, &sp5C)) {
sp4C = false;
} else if (((play->state.frames % 4) == 2) &&
!BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->unk_46C, &sp50, &sp60, true,
!BgCheck_EntityLineTest1(&play->colCtx, &this->actor.world.pos, &this->subCamId, &sp50, &sp60, true,
false, false, true, &sp5C)) {
sp4C = false;
} else if (((play->state.frames % 4) == 3) &&
@ -949,7 +949,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po
if (limbIndex == 1) {
Matrix_MultVec3f(&sp7C, &this->unk_454);
Matrix_MultVec3f(&sp70, &this->unk_460);
Matrix_MultVec3f(&sp64, &this->unk_46C);
Matrix_MultVec3f(&sp64, &this->subCamId);
Matrix_MultVec3f(&sp58, &this->unk_478);
Matrix_MultVec3f(&sp4C, &this->unk_484);
}

View file

@ -43,7 +43,7 @@ typedef struct EnSw {
/* 0x0448 */ Vec3f unk_448;
/* 0x0454 */ Vec3f unk_454;
/* 0x0460 */ Vec3f unk_460;
/* 0x046C */ Vec3f unk_46C;
/* 0x046C */ Vec3f subCamId;
/* 0x0478 */ Vec3f unk_478;
/* 0x0484 */ Vec3f unk_484;
/* 0x0490 */ char unk_490[0x48];

View file

@ -671,10 +671,10 @@ void func_80B15424(EnTa* this, PlayState* play) {
if (gSaveContext.eventInf[0] & 0x100) {
play->fadeTransition = 46;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
} else {
play->fadeTransition = 38;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
}
play->sceneLoadFlag = 0x14;

View file

@ -496,7 +496,7 @@ void EnTest_Idle(EnTest* this, PlayState* play) {
if ((player->swordState != 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, play);
@ -627,7 +627,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) {
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);
@ -663,7 +663,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) {
EnTest_SetupJumpslash(this);
return;
}
} else if (player->heldItemActionParam != PLAYER_AP_NONE) {
} else if (player->heldItemAction != PLAYER_IA_NONE) {
if (this->actor.isTargeted) {
if ((play->gameplayFrames % 2) != 0) {
func_808627C4(this, play);
@ -1238,7 +1238,7 @@ void func_808621D4(EnTest* this, PlayState* play) {
(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);
@ -1277,7 +1277,7 @@ void func_80862418(EnTest* this, PlayState* play) {
(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);
@ -1323,7 +1323,7 @@ void EnTest_Stunned(EnTest* this, PlayState* play) {
((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);
@ -1459,7 +1459,7 @@ void func_808628C8(EnTest* this, PlayState* play) {
if (!EnTest_ReactToProjectile(play, this)) {
EnTest_ChooseAction(this, play);
}
} else if (player->heldItemActionParam != PLAYER_AP_NONE) {
} else if (player->heldItemAction != PLAYER_IA_NONE) {
if ((play->gameplayFrames % 2) != 0) {
EnTest_SetupIdle(this);
} else {

View file

@ -128,16 +128,16 @@ void EnTorch2_Init(Actor* thisx, PlayState* play2) {
sInput.cur.button = sInput.press.button = sInput.rel.button = 0;
sInput.cur.stick_x = sInput.cur.stick_y = 0;
this->currentShield = PLAYER_SHIELD_HYLIAN;
this->heldItemActionParam = this->heldItemId = PLAYER_AP_SWORD_MASTER;
this->heldItemAction = this->heldItemId = PLAYER_IA_SWORD_MASTER;
Player_SetModelGroup(this, 2);
play->playerInit(this, play, &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;
@ -162,11 +162,11 @@ void EnTorch2_Destroy(Actor* thisx, PlayState* play) {
s32 pad;
Player* this = (Player*)thisx;
Effect_Delete(play, this->swordEffectIndex);
Effect_Delete(play, this->meleeWeaponEffectIndex);
func_800F5B58();
Collider_DestroyCylinder(play, &this->cylinder);
Collider_DestroyQuad(play, &this->swordQuads[0]);
Collider_DestroyQuad(play, &this->swordQuads[1]);
Collider_DestroyQuad(play, &this->meleeWeaponQuads[0]);
Collider_DestroyQuad(play, &this->meleeWeaponQuads[1]);
Collider_DestroyQuad(play, &this->shieldQuad);
}
@ -280,16 +280,16 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
// 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
@ -304,8 +304,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
}
}
if ((sCounterState != 0) && (this->swordState != 0)) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->swordQuads[0].base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->swordQuads[1].base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->meleeWeaponQuads[0].base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->meleeWeaponQuads[1].base);
}
// Ignores hits when jumping on Link's sword
@ -328,7 +328,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
// Handles Dark Link's initial reaction to jumpslashes
if (((player->swordState != 0) || (player->actor.velocity.y > -3.0f)) &&
(player->swordAnimation == JUMPSLASH_START)) {
(player->meleeWeaponAnimation == JUMPSLASH_START)) {
this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
if (play->gameplayFrames % 2) {
@ -382,13 +382,13 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
// Handles Dark Link's reaction to sword attack other than jumpslashes
if (func_800354B4(play, &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) &&
(player->meleeWeaponAnimation == STAB_1H) && (this->actor.xzDistToPlayer <= 85.0f) &&
Actor_IsTargeted(play, &this->actor)) {
sStickTilt = 0.0f;
@ -414,17 +414,17 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
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);
@ -457,8 +457,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
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->swordState == 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) {
@ -557,8 +557,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
// 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.magicState == 3) && (player->swordState == 0 || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) ||
(player->meleeWeaponAnimation > BIG_SPIN_2H))) {
sStickTilt = 0.0f;
input->cur.stick_x = 0;
input->cur.stick_y = 0;
@ -589,12 +589,12 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
if ((this->actor.colChkInfo.health == 0) && sDeathFlag) {
this->csMode = 0x18;
this->unk_448 = &player->actor;
this->unk_46A = 1;
this->doorBgCamIndex = 1;
sDeathFlag = false;
}
if ((this->invincibilityTimer == 0) && (this->actor.colChkInfo.health != 0) &&
(this->cylinder.base.acFlags & AC_HIT) && !(this->stateFlags1 & 0x04000000) &&
!(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();
@ -704,8 +704,8 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) {
this->skelAnime.curFrame = player->skelAnime.curFrame - player->skelAnime.playSpeed;
this->skelAnime.playSpeed = player->skelAnime.playSpeed;
LinkAnimation_Update(play, &this->skelAnime);
Collider_ResetQuadAT(play, &this->swordQuads[0].base);
Collider_ResetQuadAT(play, &this->swordQuads[1].base);
Collider_ResetQuadAT(play, &this->meleeWeaponQuads[0].base);
Collider_ResetQuadAT(play, &this->meleeWeaponQuads[1].base);
}
}
if (sStaggerTimer != 0) {

View file

@ -294,7 +294,7 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) {
playerYawDiff = ABS(playerYawDiff);
if (func_800354B4(play, &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(PlayState* play, EnWf* this, s16 mustChoose) {
if ((this->actor.bgCheckFlags & 8) && (ABS(wallYawDiff) < 0x2EE0) && (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) && (play->gameplayFrames % 2) != 0) {
@ -1021,7 +1021,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) {
if ((ABS(yawDiff) <= 0x4000) && (this->actor.xzDistToPlayer < 60.0f) &&
(ABS(this->actor.yDistToPlayer) < 50.0f)) {
if (func_800354B4(play, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
} else if ((play->gameplayFrames % 2) != 0) {
EnWf_SetupBlocking(this);
@ -1044,7 +1044,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) {
}
} else if (this->actionTimer == 0) {
if (func_800354B4(play, &this->actor, 100.0f, 10000, 0x4000, this->actor.shape.rot.y)) {
if (player->swordAnimation == 0x11) {
if (player->meleeWeaponAnimation == 0x11) {
EnWf_SetupBlocking(this);
} else if ((play->gameplayFrames % 2) != 0) {
EnWf_SetupBlocking(this);

View file

@ -1808,7 +1808,7 @@ void func_80B5772C(EnZl3* this, PlayState* play) {
}
void func_80B57754(EnZl3* this, PlayState* play) {
if (gSaveContext.unk_13F0 == 0) {
if (gSaveContext.magicState == 0) {
Actor_Spawn(&play->actorCtx, play, ACTOR_OCEFF_WIPE4, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 1);
func_80B56DA4(this);

View file

@ -5122,7 +5122,7 @@ void Fishing_HandleOwnerDialog(Fishing* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (gSaveContext.temporaryWeapon) {
player->currentSwordItem = ITEM_NONE;
player->currentSwordItemId = ITEM_NONE;
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
gSaveContext.temporaryWeapon = false;

View file

@ -175,7 +175,7 @@ void ItemOcarina_StartSoTCutscene(ItemOcarina* this, PlayState* play) {
} else {
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
play->nextEntranceIndex = 0x050F;
gSaveContext.nextCutsceneIndex = 0;
}

View file

@ -176,8 +176,8 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) {
if (dmgFlags & 0x20820) {
interactionType = 1;
}
} else if (player->heldItemActionParam == PLAYER_AP_STICK) {
Math_Vec3f_Diff(&player->swordInfo[0].tip, &this->actor.world.pos, &tipToFlame);
} else if (player->heldItemAction == PLAYER_IA_STICK) {
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

@ -72,7 +72,7 @@ void OceffSpot_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode2);
func_800876C8(play);
if ((gSaveContext.nayrusLoveTimer != 0) && (play->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) {
player->stateFlags3 |= 0x40;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -62,7 +62,7 @@ void OceffStorm_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -42,7 +42,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -42,7 +42,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -45,7 +45,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= 0x40;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

File diff suppressed because it is too large Load diff

View file

@ -2155,30 +2155,30 @@ void FileChoose_LoadGame(GameState* thisx) {
gSaveContext.unk_13EE = 0x32;
gSaveContext.nayrusLoveTimer = 0;
gSaveContext.healthAccumulator = 0;
gSaveContext.unk_13F0 = 0;
gSaveContext.unk_13F2 = 0;
gSaveContext.magicState = 0;
gSaveContext.prevMagicState = 0;
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.skyboxTime = 0;
gSaveContext.nextTransition = 0xFF;
gSaveContext.nextTransitionType = 0xFF;
gSaveContext.nextCutsceneIndex = 0xFFEF;
gSaveContext.cutsceneTrigger = 0;
gSaveContext.chamberCutsceneNum = 0;
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.unk_13C3 = 0;
gSaveContext.retainWeatherMode = 0;
for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) {
gSaveContext.buttonStatus[buttonIndex] = BTN_ENABLED;
}
gSaveContext.unk_13E7 = gSaveContext.unk_13E8 = gSaveContext.unk_13EA = gSaveContext.unk_13EC =
gSaveContext.unk_13F4 = 0;
gSaveContext.magicCapacity = 0;
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.magicLevel = gSaveContext.magic;
osSyncPrintf(VT_FGCOL(GREEN));
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.unk_13F6), gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d MAGIC_NOW=%d\n", ((void)0, gSaveContext.magicFillTarget), gSaveContext.magic);
osSyncPrintf(VT_RST);
gSaveContext.naviTimer = 0;

View file

@ -22,9 +22,9 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
osSyncPrintf(VT_RST);
if (gSaveContext.fileNum == 0xFF) {
Sram_InitDebugSave();
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.unk_13F4 = 0;
gSaveContext.magicCapacity = 0;
gSaveContext.magicLevel = gSaveContext.magic;
}
for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) {
@ -63,9 +63,9 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) {
osSyncPrintf(VT_RST);
if (gSaveContext.fileNum == 0xFF) {
Sram_InitDebugSave();
gSaveContext.unk_13F6 = gSaveContext.magic;
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magic = 0;
gSaveContext.unk_13F4 = 0;
gSaveContext.magicCapacity = 0;
gSaveContext.magicLevel = gSaveContext.magic;
}
for (int buttonIndex = 0; buttonIndex < ARRAY_COUNT(gSaveContext.buttonStatus); buttonIndex++) {

View file

@ -4218,20 +4218,20 @@ void KaleidoScope_Update(PlayState* play)
if (gSaveContext.n64ddFlag && Randomizer_GetSettingValue(RSK_SHUFFLE_ENTRANCES)) {
Grotto_ForceGrottoReturn();
}
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
gSaveContext.health = 0x30;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;
gSaveContext.unk_13F0 = 0;
gSaveContext.unk_13F2 = 0;
gSaveContext.magicState = 0;
gSaveContext.prevMagicState = 0;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d → ", gSaveContext.unk_13F6);
gSaveContext.unk_13F4 = 0;
gSaveContext.unk_13F6 = gSaveContext.magic;
osSyncPrintf("Z_MAGIC_NOW_NOW=%d → ", gSaveContext.magicFillTarget);
gSaveContext.magicCapacity = 0;
gSaveContext.magicFillTarget = gSaveContext.magic;
gSaveContext.magicLevel = gSaveContext.magic = 0;
osSyncPrintf("MAGIC_NOW=%d ", gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget);
osSyncPrintf(VT_RST);
} else {
play->state.running = 0;