This commit is contained in:
inspectredc
2023-10-20 00:13:33 +01:00
committed by GitHub
parent cff2e37287
commit 9d581f10e7
26 changed files with 130 additions and 130 deletions
@@ -55,7 +55,7 @@ void ArrowFire_Init(Actor* thisx, PlayState* play) {
}
void ArrowFire_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
Magic_Reset(play);
LOG_STRING("消滅"); // "Disappearance"
}
@@ -56,7 +56,7 @@ void ArrowIce_Init(Actor* thisx, PlayState* play) {
}
void ArrowIce_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
Magic_Reset(play);
LOG_STRING("消滅"); // "Disappearance"
}
@@ -56,7 +56,7 @@ void ArrowLight_Init(Actor* thisx, PlayState* play) {
}
void ArrowLight_Destroy(Actor* thisx, PlayState* play) {
func_800876C8(play);
Magic_Reset(play);
LOG_STRING("消滅"); // "Disappearance"
}
@@ -741,7 +741,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
switch (actionIndex) {
case FAIRY_UPGRADE_MAGIC:
gSaveContext.isMagicAcquired = true;
gSaveContext.magicFillTarget = 0x30;
gSaveContext.magicFillTarget = MAGIC_NORMAL_METER;
Interface_ChangeAlpha(9);
break;
case FAIRY_UPGRADE_DOUBLE_MAGIC:
@@ -749,7 +749,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
gSaveContext.isMagicAcquired = true;
}
gSaveContext.isDoubleMagicAcquired = true;
gSaveContext.magicFillTarget = 0x60;
gSaveContext.magicFillTarget = MAGIC_DOUBLE_METER;
gSaveContext.magicLevel = 0;
Interface_ChangeAlpha(9);
break;
@@ -85,9 +85,9 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) {
this->unk_1CA = 0;
if (player->stateFlags2 & 0x20000) {
if (!gSaveContext.isMagicAcquired || gSaveContext.magicState ||
if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) ||
(((this->actor.params & 0xFF00) >> 8) &&
!(func_80087708(play, (this->actor.params & 0xFF00) >> 8, 0)))) {
!(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) {
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,
@@ -116,7 +116,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);
@@ -158,8 +158,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
if (this->unk_1CA == 0) {
if (player->unk_858 >= 0.1f) {
if ((gSaveContext.magicState) || (((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;
@@ -193,7 +193,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) {
} else {
player->stateFlags2 &= ~0x20000;
if ((this->actor.params & 0xFF00) >> 8) {
gSaveContext.magicState = 1;
gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP;
}
if (player->unk_858 < 0.85f) {
this->collider.info.toucher.dmgFlags = D_80AA044C[this->unk_1C7];
@@ -195,7 +195,7 @@ void UseBow(Actor* thisx, PlayState* play, u8 started, u8 arrowType) {
} else if (started == 0) {
if (this->itemTimer <= 0) {
if (AMMO(ITEM_BOW) > 0) {
if (arrowType >= 1 && !func_80087708(play, magicArrowCosts[arrowType], 0)) {
if (arrowType >= 1 && !Magic_RequestChange(play, magicArrowCosts[arrowType], MAGIC_CONSUME_NOW)) {
func_80078884(NA_SE_SY_ERROR);
this->canMove = 1;
return;
@@ -455,7 +455,7 @@ void UseSpell(Actor* thisx, PlayState* play, u8 started, u8 spellType) {
if (started == 0 && this->usedSpell != 0) {
this->itemTimer = 10;
gSaveContext.magicState = 5;
gSaveContext.magicState = MAGIC_STATE_RESET;
switch (this->usedSpell) {
case 1:
@@ -487,7 +487,7 @@ void UseSpell(Actor* thisx, PlayState* play, u8 started, u8 spellType) {
break;
}
gSaveContext.magicState = 3;
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
this->magicTimer--;
if (this->magicTimer <= 0) {
gSaveContext.magic--;
@@ -497,7 +497,7 @@ void UseSpell(Actor* thisx, PlayState* play, u8 started, u8 spellType) {
this->itemTimer = 10;
this->usedSpell = 0;
gSaveContext.magicState = 5;
gSaveContext.magicState = MAGIC_STATE_RESET;
}
}
}
@@ -568,7 +568,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.magicState == 3) && (player->meleeWeaponState == 0 || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) ||
if ((gSaveContext.magicState == MAGIC_STATE_METER_FLASH_1) && (player->meleeWeaponState == 0 || (player->meleeWeaponAnimation < SPIN_ATTACK_1H) ||
(player->meleeWeaponAnimation > BIG_SPIN_2H))) {
sStickTilt = 0.0f;
input->cur.stick_x = 0;
@@ -1810,7 +1810,7 @@ void func_80B5772C(EnZl3* this, PlayState* play) {
}
void func_80B57754(EnZl3* this, PlayState* play) {
if (gSaveContext.magicState == 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, true);
func_80B56DA4(this);
@@ -65,7 +65,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);
}
}
@@ -93,7 +93,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) {
@@ -70,7 +70,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("消滅");
}
@@ -70,7 +70,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_RESTORE_NAYRUS_LOVE;
}
@@ -60,7 +60,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_RESTORE_NAYRUS_LOVE;
}
@@ -40,7 +40,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_RESTORE_NAYRUS_LOVE;
}
@@ -40,7 +40,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_RESTORE_NAYRUS_LOVE;
}
@@ -43,7 +43,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_RESTORE_NAYRUS_LOVE;
}
@@ -39,7 +39,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) {
@@ -2224,7 +2224,7 @@ s32 func_8083442C(Player* this, PlayState* play) {
s32 magicArrowType;
if ((this->heldItemAction >= PLAYER_IA_BOW_FIRE) && (this->heldItemAction <= PLAYER_IA_BOW_0E) &&
(gSaveContext.magicState != 0)) {
(gSaveContext.magicState != MAGIC_STATE_IDLE)) {
func_80078884(NA_SE_SY_ERROR);
} else {
func_80833638(this, func_808351D4);
@@ -2240,7 +2240,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;
}
@@ -2979,7 +2979,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {
}
if (actionParam == PLAYER_IA_LENS_OF_TRUTH) {
if (func_80087708(play, 0, 3)) {
if (Magic_RequestChange(play, 0, MAGIC_CONSUME_LENS)) {
if (play->actorCtx.lensActive) {
Actor_DisableLens(play);
} else {
@@ -3004,7 +3004,7 @@ void func_80835F44(PlayState* play, Player* this, s32 item) {
temp = Player_ActionToMagicSpell(this, actionParam);
if (temp >= 0) {
if (((actionParam == PLAYER_IA_FARORES_WIND) && (gSaveContext.respawn[RESPAWN_MODE_TOP].data > 0)) ||
((gSaveContext.magicCapacity != 0) && (gSaveContext.magicState == 0) &&
((gSaveContext.magicCapacity != 0) && (gSaveContext.magicState == MAGIC_STATE_IDLE) &&
(gSaveContext.magic >= sMagicSpellCosts[temp]))) {
this->itemAction = actionParam;
this->unk_6AD = 4;
@@ -4981,7 +4981,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);
u8 isFastFarores = CVarGetInteger("gFastFarores", 0) && this->itemAction == PLAYER_IA_FARORES_WIND;
@@ -9740,7 +9740,7 @@ void Player_Init(Actor* thisx, PlayState* play2) {
}
if (gSaveContext.nayrusLoveTimer != 0) {
gSaveContext.magicState = 3;
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
func_80846A00(play, this, 1);
this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
@@ -10666,8 +10666,8 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
func_80848C74(play, this);
}
if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.magicState == 0)) {
gSaveContext.magicState = 3;
if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) && (gSaveContext.magicState == MAGIC_STATE_IDLE)) {
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
func_80846A00(play, this, 1);
this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
@@ -11373,7 +11373,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;
@@ -13098,39 +13098,39 @@ void func_8084EAC0(Player* this, PlayState* play) {
}
if (CVarGetInteger("gBlueManaPercentRestore", 0)) {
if (gSaveContext.magicState != 10) {
if (gSaveContext.magicState != MAGIC_STATE_ADD) {
Magic_Fill(play);
}
func_80087708(play,
Magic_RequestChange(play,
(gSaveContext.magicLevel * 48 * CVarGetInteger("gBluePotionMana", 100) / 100 + 15) /
16 * 16,
5);
MAGIC_ADD);
} else {
if (gSaveContext.magicState != 10) {
if (gSaveContext.magicState != MAGIC_STATE_ADD) {
Magic_Fill(play);
}
func_80087708(play, CVarGetInteger("gBluePotionMana", 100), 5);
Magic_RequestChange(play, CVarGetInteger("gBluePotionMana", 100), MAGIC_ADD);
;
}
} else if (CVarGetInteger("gGreenPotionEffect", 0) &&
this->itemAction == PLAYER_IA_BOTTLE_POTION_GREEN) {
if (CVarGetInteger("gGreenPercentRestore", 0)) {
if (gSaveContext.magicState != 10) {
if (gSaveContext.magicState != MAGIC_STATE_ADD) {
Magic_Fill(play);
}
func_80087708(play,
Magic_RequestChange(play,
(gSaveContext.magicLevel * 48 * CVarGetInteger("gGreenPotionMana", 100) / 100 + 15) /
16 * 16,
5);
MAGIC_ADD);
} else {
if (gSaveContext.magicState != 10) {
if (gSaveContext.magicState != MAGIC_STATE_ADD) {
Magic_Fill(play);
}
func_80087708(play, CVarGetInteger("gGreenPotionMana", 100), 5);
Magic_RequestChange(play, CVarGetInteger("gGreenPotionMana", 100), MAGIC_ADD);
;
}
} else if (CVarGetInteger("gMilkEffect", 0) && (this->itemAction == PLAYER_IA_BOTTLE_MILK_FULL ||
@@ -13174,7 +13174,7 @@ void func_8084EAC0(Player* this, PlayState* play) {
func_8083C0E8(this, play);
func_8005B1A4(Play_GetCamera(play, 0));
} else if (this->unk_850 == 1) {
if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != 9)) {
if ((gSaveContext.healthAccumulator == 0) && (gSaveContext.magicState != MAGIC_STATE_FILL)) {
func_80832B78(play, this, &gPlayerAnim_link_bottle_drink_demo_end);
this->unk_850 = 2;
Player_UpdateBottleHeld(play, this, ITEM_BOTTLE, PLAYER_IA_BOTTLE);
@@ -13933,7 +13933,7 @@ void func_808507F4(Player* this, PlayState* play) {
u8 isFastFarores = CVarGetInteger("gFastFarores", 0) && this->itemAction == PLAYER_IA_FARORES_WIND;
if (LinkAnimation_Update(play, &this->skelAnime)) {
if (this->unk_84F < 0) {
if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || isFastFarores || (gSaveContext.magicState == 0)) {
if ((this->itemAction == PLAYER_IA_NAYRUS_LOVE) || isFastFarores || (gSaveContext.magicState == MAGIC_STATE_IDLE)) {
func_80839FFC(this, play);
func_8005B1A4(Play_GetCamera(play, 0));
}
@@ -13944,10 +13944,10 @@ void func_808507F4(Player* this, PlayState* play) {
if (func_80846A00(play, this, this->unk_84F) != NULL) {
this->stateFlags1 |= PLAYER_STATE1_IN_ITEM_CS | PLAYER_STATE1_IN_CUTSCENE;
if ((this->unk_84F != 0) || (gSaveContext.respawn[RESPAWN_MODE_TOP].data <= 0)) {
gSaveContext.magicState = 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 * (isFastFarores ? 2 : 1));
@@ -2987,8 +2987,8 @@ void FileChoose_LoadGame(GameState* thisx) {
gSaveContext.unk_13EE = 0x32;
gSaveContext.nayrusLoveTimer = 0;
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = 0;
gSaveContext.prevMagicState = 0;
gSaveContext.magicState = MAGIC_STATE_IDLE;
gSaveContext.prevMagicState = MAGIC_STATE_IDLE;
gSaveContext.forcedSeqId = NA_BGM_GENERAL_SFX;
gSaveContext.skyboxTime = 0;
gSaveContext.nextTransitionType = 0xFF;
@@ -4167,8 +4167,8 @@ void KaleidoScope_Update(PlayState* play)
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = 0;
gSaveContext.prevMagicState = 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.magicFillTarget);