mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Document Magic (#1199)
* Magic docs WIP * More docs, first round finished * Better docs * More renaming * Simpler name * Another small adjustment * rm if(1) * Better names again after in-game testing * Change comments * change comment * Big rename based on all the suggestions * Small touch-up * More PR Suggestions * RESTORE_IDLE -> RESET * More docs * Capitalization * PR suggestions * Make declaration consistent * Health_ChangeBy (amount) * PR Suggestions * Missed one * More PR Suggestions * Change comment * Add another clarity comment * Discord discussions on `magicFillTarget` * Comments * grammar * More comment clarity * Another bad comment * PR suggestions, improved comments * One more comment * one more thing * bar -> meter
This commit is contained in:
parent
2e6279bc8e
commit
e68f321777
35 changed files with 327 additions and 249 deletions
|
@ -54,7 +54,7 @@ void ArrowFire_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void ArrowFire_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
LOG_STRING("消滅", "../z_arrow_fire.c", 421); // "Disappearance"
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void ArrowIce_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
LOG_STRING("消滅", "../z_arrow_ice.c", 415); // "Disappearance"
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void ArrowLight_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
LOG_STRING("消滅", "../z_arrow_light.c", 403); // "Disappearance"
|
||||
}
|
||||
|
||||
|
|
|
@ -181,12 +181,12 @@ void BgDyYoseizo_CheckMagicAcquired(BgDyYoseizo* this, PlayState* play) {
|
|||
if (Flags_GetSwitch(play, 0x38)) {
|
||||
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
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;
|
||||
}
|
||||
|
@ -225,7 +225,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;
|
||||
|
@ -233,7 +233,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;
|
||||
|
@ -466,7 +466,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) {
|
||||
|
@ -709,16 +709,18 @@ 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 = MAGIC_NORMAL_METER;
|
||||
// magicLevel is already 0, setting isMagicAcquired to true triggers magicCapacity to grow
|
||||
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 = MAGIC_DOUBLE_METER;
|
||||
// Setting magicLevel to 0 triggers magicCapacity to grow
|
||||
gSaveContext.magicLevel = 0;
|
||||
Interface_ChangeAlpha(9);
|
||||
break;
|
||||
|
@ -750,8 +752,8 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
|
|||
itemPos.y, itemPos.z, 0, 0, 0, sExItemTypes[actionIndex]);
|
||||
|
||||
if (this->item != NULL) {
|
||||
if (gSaveContext.magicAcquired == 0) {
|
||||
gSaveContext.magicAcquired = 1;
|
||||
if (!gSaveContext.isMagicAcquired) {
|
||||
gSaveContext.isMagicAcquired = true;
|
||||
} else {
|
||||
Magic_Fill(play);
|
||||
}
|
||||
|
|
|
@ -1189,7 +1189,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;
|
||||
|
|
|
@ -84,8 +84,9 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
|
|||
this->unk_1CA = 0;
|
||||
|
||||
if (player->stateFlags2 & PLAYER_STATE2_17) {
|
||||
if (!gSaveContext.magicAcquired || gSaveContext.unk_13F0 ||
|
||||
(((this->actor.params & 0xFF00) >> 8) && !(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 0)))) {
|
||||
if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) ||
|
||||
(((this->actor.params & 0xFF00) >> 8) &&
|
||||
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) {
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4,
|
||||
|
@ -114,7 +115,7 @@ void EnMThunder_Destroy(Actor* thisx, PlayState* play) {
|
|||
EnMThunder* this = (EnMThunder*)thisx;
|
||||
|
||||
if (this->unk_1CA != 0) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
|
||||
Collider_DestroyCylinder(play, &this->collider);
|
||||
|
@ -156,8 +157,9 @@ 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) &&
|
||||
!(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 4)))) {
|
||||
if ((gSaveContext.magicState != MAGIC_STATE_IDLE) ||
|
||||
(((this->actor.params & 0xFF00) >> 8) &&
|
||||
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) {
|
||||
func_80A9F350(this, play);
|
||||
func_80A9EFE0(this, func_80A9F350);
|
||||
this->unk_1C8 = 0;
|
||||
|
@ -191,7 +193,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
|
|||
} else {
|
||||
player->stateFlags2 &= ~PLAYER_STATE2_17;
|
||||
if ((this->actor.params & 0xFF00) >> 8) {
|
||||
gSaveContext.unk_13F0 = 1;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
|
||||
}
|
||||
if (player->unk_858 < 0.85f) {
|
||||
this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7];
|
||||
|
|
|
@ -616,7 +616,7 @@ void func_80ACB274(EnOwl* this, PlayState* play) {
|
|||
void EnOwl_WaitDeathMountainShortcut(EnOwl* this, PlayState* play) {
|
||||
EnOwl_LookAtLink(this, play);
|
||||
|
||||
if (!gSaveContext.magicAcquired) {
|
||||
if (!gSaveContext.isMagicAcquired) {
|
||||
if (func_80ACA558(this, play, 0x3062)) {
|
||||
Audio_PlayFanfare(NA_BGM_OWL);
|
||||
this->actionFunc = func_80ACB274;
|
||||
|
|
|
@ -531,7 +531,7 @@ 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) &&
|
||||
if ((gSaveContext.magicState == MAGIC_STATE_METER_FLASH_1) &&
|
||||
(player->meleeWeaponState == 0 || !((player->meleeWeaponAnimation >= PLAYER_MWA_SPIN_ATTACK_1H) &&
|
||||
(player->meleeWeaponAnimation <= PLAYER_MWA_BIG_SPIN_2H)))) {
|
||||
sStickTilt = 0.0f;
|
||||
|
|
|
@ -1810,7 +1810,7 @@ void func_80B5772C(EnZl3* this, PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80B57754(EnZl3* this, PlayState* play) {
|
||||
if (gSaveContext.unk_13F0 == 0) {
|
||||
if (gSaveContext.magicState == MAGIC_STATE_IDLE) {
|
||||
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);
|
||||
|
|
|
@ -64,7 +64,7 @@ void MagicDark_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
void MagicDark_Destroy(Actor* thisx, PlayState* play) {
|
||||
if (gSaveContext.nayrusLoveTimer == 0) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ void MagicFire_Init(Actor* thisx, PlayState* play) {
|
|||
}
|
||||
|
||||
void MagicFire_Destroy(Actor* thisx, PlayState* play) {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
|
||||
void MagicFire_UpdateBeforeCast(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -69,7 +69,7 @@ void MagicWind_Init(Actor* thisx, PlayState* play) {
|
|||
void MagicWind_Destroy(Actor* thisx, PlayState* play) {
|
||||
MagicWind* this = (MagicWind*)thisx;
|
||||
SkelCurve_Destroy(play, &this->skelCurve);
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
// "wipe out"
|
||||
LOG_STRING("消滅", "../z_magic_wind.c", 505);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ void OceffSpot_Destroy(Actor* thisx, PlayState* play) {
|
|||
|
||||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode1);
|
||||
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode2);
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
if ((gSaveContext.nayrusLoveTimer != 0) && (play->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) {
|
||||
player->stateFlags3 |= PLAYER_STATE3_6;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ void OceffStorm_Destroy(Actor* thisx, PlayState* play) {
|
|||
OceffStorm* this = (OceffStorm*)thisx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
player->stateFlags3 |= PLAYER_STATE3_6;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play) {
|
|||
OceffWipe* this = (OceffWipe*)thisx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
player->stateFlags3 |= PLAYER_STATE3_6;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play) {
|
|||
OceffWipe2* this = (OceffWipe2*)thisx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
player->stateFlags3 |= PLAYER_STATE3_6;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play) {
|
|||
OceffWipe3* this = (OceffWipe3*)thisx;
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
player->stateFlags3 |= PLAYER_STATE3_6;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void OceffWipe4_Init(Actor* thisx, PlayState* play) {
|
|||
void OceffWipe4_Destroy(Actor* thisx, PlayState* play) {
|
||||
OceffWipe4* this = (OceffWipe4*)thisx;
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
|
||||
void OceffWipe4_Update(Actor* thisx, PlayState* play) {
|
||||
|
|
|
@ -2174,7 +2174,7 @@ s32 func_8083442C(Player* this, PlayState* play) {
|
|||
s32 magicArrowType;
|
||||
|
||||
if ((this->heldItemActionParam >= PLAYER_AP_BOW_FIRE) && (this->heldItemActionParam <= PLAYER_AP_BOW_0E) &&
|
||||
(gSaveContext.unk_13F0 != 0)) {
|
||||
(gSaveContext.magicState != MAGIC_STATE_IDLE)) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
} else {
|
||||
func_80833638(this, func_808351D4);
|
||||
|
@ -2190,7 +2190,7 @@ s32 func_8083442C(Player* this, PlayState* play) {
|
|||
|
||||
if (this->unk_860 >= 0) {
|
||||
if ((magicArrowType >= 0) && (magicArrowType <= 2) &&
|
||||
!func_80087708(play, sMagicArrowCosts[magicArrowType], 0)) {
|
||||
!Magic_RequestChange(play, sMagicArrowCosts[magicArrowType], MAGIC_CONSUME_NOW)) {
|
||||
arrowType = ARROW_NORMAL;
|
||||
}
|
||||
|
||||
|
@ -2881,7 +2881,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {
|
|||
(play->actorCtx.actorLists[ACTORCAT_EXPLOSIVE].length >= 3)))))) {
|
||||
func_80078884(NA_SE_SY_ERROR);
|
||||
} else if (actionParam == PLAYER_AP_LENS) {
|
||||
if (func_80087708(play, 0, 3)) {
|
||||
if (Magic_RequestChange(play, 0, MAGIC_CONSUME_LENS)) {
|
||||
if (play->actorCtx.lensActive) {
|
||||
Actor_DisableLens(play);
|
||||
} else {
|
||||
|
@ -2900,7 +2900,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {
|
|||
}
|
||||
} else if ((temp = Player_ActionToMagicSpell(this, actionParam)) >= 0) {
|
||||
if (((actionParam == PLAYER_AP_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) ||
|
||||
((gSaveContext.unk_13F4 != 0) && (gSaveContext.unk_13F0 == 0) &&
|
||||
((gSaveContext.magicCapacity != 0) && (gSaveContext.magicState == MAGIC_STATE_IDLE) &&
|
||||
(gSaveContext.magic >= sMagicSpellCosts[temp]))) {
|
||||
this->itemActionParam = actionParam;
|
||||
this->unk_6AD = 4;
|
||||
|
@ -4869,7 +4869,7 @@ void func_8083AF44(PlayState* play, Player* this, s32 magicSpell) {
|
|||
func_80835DE4(play, this, func_808507F4, 0);
|
||||
|
||||
this->unk_84F = magicSpell - 3;
|
||||
func_80087708(play, sMagicSpellCosts[magicSpell], 4);
|
||||
Magic_RequestChange(play, sMagicSpellCosts[magicSpell], MAGIC_CONSUME_WAIT_PREVIEW);
|
||||
|
||||
LinkAnimation_PlayOnceSetSpeed(play, &this->skelAnime, &gPlayerAnim_002D28, 0.83f);
|
||||
|
||||
|
@ -9381,7 +9381,7 @@ void Player_Init(Actor* thisx, PlayState* play2) {
|
|||
}
|
||||
|
||||
if (gSaveContext.nayrusLoveTimer != 0) {
|
||||
gSaveContext.unk_13F0 = 3;
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
|
||||
func_80846A00(play, this, 1);
|
||||
this->stateFlags3 &= ~PLAYER_STATE3_6;
|
||||
}
|
||||
|
@ -10169,8 +10169,9 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
|
|||
func_80848C74(play, this);
|
||||
}
|
||||
|
||||
if ((this->stateFlags3 & PLAYER_STATE3_6) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.unk_13F0 == 0)) {
|
||||
gSaveContext.unk_13F0 = 3;
|
||||
if ((this->stateFlags3 & PLAYER_STATE3_6) && (gSaveContext.nayrusLoveTimer != 0) &&
|
||||
(gSaveContext.magicState == MAGIC_STATE_IDLE)) {
|
||||
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
|
||||
func_80846A00(play, this, 1);
|
||||
this->stateFlags3 &= ~PLAYER_STATE3_6;
|
||||
}
|
||||
|
@ -10758,7 +10759,7 @@ void Player_Destroy(Actor* thisx, PlayState* play) {
|
|||
Collider_DestroyQuad(play, &this->meleeWeaponQuads[1]);
|
||||
Collider_DestroyQuad(play, &this->shieldQuad);
|
||||
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
|
||||
gSaveContext.linkAge = play->linkAgeOnLoad;
|
||||
}
|
||||
|
@ -12366,7 +12367,7 @@ void func_8084EAC0(Player* this, PlayState* play) {
|
|||
func_8083C0E8(this, play);
|
||||
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN));
|
||||
} else if (this->unk_850 == 1) {
|
||||
if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.unk_13F0 != 9)) {
|
||||
if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) {
|
||||
func_80832B78(play, this, &gPlayerAnim_002660);
|
||||
this->unk_850 = 2;
|
||||
Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_AP_BOTTLE);
|
||||
|
@ -13107,7 +13108,7 @@ static struct_80832924 D_80854A8C[][2] = {
|
|||
void func_808507F4(Player* this, PlayState* play) {
|
||||
if (LinkAnimation_Update(play, &this->skelAnime)) {
|
||||
if (this->unk_84F < 0) {
|
||||
if ((this->itemActionParam == PLAYER_AP_NAYRUS_LOVE) || (gSaveContext.unk_13F0 == 0)) {
|
||||
if ((this->itemActionParam == PLAYER_AP_NAYRUS_LOVE) || (gSaveContext.magicState == MAGIC_STATE_IDLE)) {
|
||||
func_80839FFC(this, play);
|
||||
func_8005B1A4(Play_GetCamera(play, CAM_ID_MAIN));
|
||||
}
|
||||
|
@ -13118,10 +13119,10 @@ void func_808507F4(Player* this, PlayState* play) {
|
|||
if (func_80846A00(play, this, this->unk_84F) != NULL) {
|
||||
this->stateFlags1 |= PLAYER_STATE1_28 | PLAYER_STATE1_29;
|
||||
if ((this->unk_84F != 0) || (gSaveContext.respawn[RESPAWN_MODE_TOP].data <= 0)) {
|
||||
gSaveContext.unk_13F0 = 1;
|
||||
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
|
||||
}
|
||||
} else {
|
||||
func_800876C8(play);
|
||||
Magic_Reset(play);
|
||||
}
|
||||
} else {
|
||||
LinkAnimation_PlayLoopSetSpeed(play, &this->skelAnime, D_80854A64[this->unk_84F], 0.83f);
|
||||
|
|
|
@ -1473,8 +1473,8 @@ 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 = MAGIC_STATE_IDLE;
|
||||
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
|
||||
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
|
||||
gSaveContext.skyboxTime = CLOCK_TIME(0, 0);
|
||||
gSaveContext.nextTransitionType = TRANS_NEXT_TYPE_DEFAULT;
|
||||
|
@ -1488,16 +1488,16 @@ void FileChoose_LoadGame(GameState* thisx) {
|
|||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = 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.magic = 0;
|
||||
gSaveContext.magicLevel = gSaveContext.magic;
|
||||
|
||||
if (1) {}
|
||||
// Set the fill target to be the saved magic amount
|
||||
gSaveContext.magicFillTarget = gSaveContext.magic;
|
||||
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing to respectively the full
|
||||
// capacity and `magicFillTarget`
|
||||
gSaveContext.magicLevel = gSaveContext.magic = 0;
|
||||
|
||||
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;
|
||||
|
|
|
@ -20,10 +20,12 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
|
|||
osSyncPrintf(VT_RST);
|
||||
if (gSaveContext.fileNum == 0xFF) {
|
||||
Sram_InitDebugSave();
|
||||
gSaveContext.unk_13F6 = gSaveContext.magic;
|
||||
gSaveContext.magic = 0;
|
||||
gSaveContext.unk_13F4 = 0;
|
||||
gSaveContext.magicLevel = gSaveContext.magic;
|
||||
// Set the fill target to be the saved magic amount
|
||||
gSaveContext.magicFillTarget = gSaveContext.magic;
|
||||
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing
|
||||
// to respectively the full capacity and `magicFillTarget`
|
||||
gSaveContext.magicCapacity = 0;
|
||||
gSaveContext.magicLevel = gSaveContext.magic = 0;
|
||||
}
|
||||
gSaveContext.buttonStatus[0] = gSaveContext.buttonStatus[1] = gSaveContext.buttonStatus[2] =
|
||||
gSaveContext.buttonStatus[3] = gSaveContext.buttonStatus[4] = BTN_ENABLED;
|
||||
|
|
|
@ -3403,16 +3403,19 @@ void KaleidoScope_Update(PlayState* play) {
|
|||
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 = MAGIC_STATE_IDLE;
|
||||
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
|
||||
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;
|
||||
// Set the fill target to be the magic amount before game over
|
||||
gSaveContext.magicFillTarget = gSaveContext.magic;
|
||||
// Set `magicLevel` and `magic` to 0 so `magicCapacity` then `magic` grows from nothing
|
||||
// to respectively the full capacity and `magicFillTarget`
|
||||
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 = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue