[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

@ -381,8 +381,8 @@ void GameState_Update(GameState* gameState) {
// Inf Magic
if (CVar_GetS32("gInfiniteMagic", 0) != 0) {
if (gSaveContext.magicAcquired && gSaveContext.magic != (gSaveContext.doubleMagic + 1) * 0x30) {
gSaveContext.magic = (gSaveContext.doubleMagic + 1) * 0x30;
if (gSaveContext.isMagicAcquired && gSaveContext.magic != (gSaveContext.isDoubleMagicAcquired + 1) * 0x30) {
gSaveContext.magic = (gSaveContext.isDoubleMagicAcquired + 1) * 0x30;
}
}
@ -440,7 +440,7 @@ void GameState_Update(GameState* gameState) {
gPlayState->nextEntranceIndex = gSaveContext.entranceIndex;
gPlayState->sceneLoadFlag = 0x14;
gPlayState->fadeTransition = 11;
gSaveContext.nextTransition = 11;
gSaveContext.nextTransitionType = 11;
warped = true;
if (gPlayState->linkAgeOnLoad == 1) {
gPlayState->linkAgeOnLoad = 0;
@ -451,7 +451,7 @@ void GameState_Update(GameState* gameState) {
}
if (gPlayState) {
if (warped && gPlayState->sceneLoadFlag != 0x0014 && gSaveContext.nextTransition == 255) {
if (warped && gPlayState->sceneLoadFlag != 0x0014 && gSaveContext.nextTransitionType == 255) {
GET_PLAYER(gPlayState)->actor.shape.rot.y = playerYaw;
GET_PLAYER(gPlayState)->actor.world.pos = playerPos;
warped = false;

View file

@ -1423,7 +1423,7 @@ s32 func_8002DF38(PlayState* play, Actor* actor, u8 csMode) {
player->csMode = csMode;
player->unk_448 = actor;
player->unk_46A = 0;
player->doorBgCamIndex = 0;
return true;
}
@ -1432,7 +1432,7 @@ s32 func_8002DF54(PlayState* play, Actor* actor, u8 csMode) {
Player* player = GET_PLAYER(play);
func_8002DF38(play, actor, csMode);
player->unk_46A = 1;
player->doorBgCamIndex = 1;
return true;
}
@ -4529,7 +4529,7 @@ void func_800355B8(PlayState* play, Vec3f* pos) {
u8 func_800355E4(PlayState* play, Collider* collider) {
Player* player = GET_PLAYER(play);
if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->swordAnimation == 0x16)) {
if ((collider->acFlags & AC_TYPE_PLAYER) && (player->swordState != 0) && (player->meleeWeaponAnimation == 0x16)) {
return true;
} else {
return false;

View file

@ -14,6 +14,6 @@ void SaveContext_Init(void) {
gSaveContext.nextDayTime = 0xFFFF;
gSaveContext.skyboxTime = 0;
gSaveContext.dogIsLost = true;
gSaveContext.nextTransition = 0xFF;
gSaveContext.nextTransitionType = 0xFF;
gSaveContext.unk_13EE = 50;
}

View file

@ -562,7 +562,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
Audio_SetCutsceneFlag(0);
gSaveContext.unk_1410 = 1;
gSaveContext.cutsceneTransitionControl = 1;
osSyncPrintf("\n分岐先指定!!=[%d]番", cmd->base); // "Future fork designation=No. [%d]"
@ -635,7 +635,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x02CA;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
}
break;
case 9:
@ -665,7 +665,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x010E;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 14:
play->nextEntranceIndex = 0x0457;
@ -695,7 +695,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x0324;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 19:
play->nextEntranceIndex = 0x013D;
@ -853,7 +853,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x01ED;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 15;
gSaveContext.nextTransition = 15;
gSaveContext.nextTransitionType = 15;
break;
case 49:
play->nextEntranceIndex = 0x058C;
@ -985,7 +985,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF4;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 71:
gSaveContext.equips.equipment |= 0x0100;
@ -1003,7 +1003,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF0;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 73:
play->linkAgeOnLoad = 1;
@ -1017,7 +1017,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->sceneLoadFlag = 0x14;
gSaveContext.cutsceneIndex = 0xFFF3;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
break;
case 75:
play->linkAgeOnLoad = 1;
@ -1109,7 +1109,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x0610;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
}
break;
case 97:
@ -1122,27 +1122,27 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x0580;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
}
break;
case 98:
play->nextEntranceIndex = 0x0564;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
break;
case 99:
play->nextEntranceIndex = 0x0608;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 100:
play->nextEntranceIndex = 0x00EE;
gSaveContext.cutsceneIndex = 0xFFF8;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
break;
case 101:
play->nextEntranceIndex = 0x01F5;
@ -1248,7 +1248,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->nextEntranceIndex = 0x0594;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 116:
if (gSaveContext.eventChkInf[12] & 0x100) {
@ -1260,7 +1260,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
}
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
break;
case 117:
gSaveContext.gameMode = 3;
@ -1275,7 +1275,7 @@ void Cutscene_Command_Terminator(PlayState* play, CutsceneContext* csCtx, CsCmdB
gSaveContext.respawn[RESPAWN_MODE_DOWN].entranceIndex = 0x0517;
Play_TriggerVoidOut(play);
gSaveContext.respawnFlag = -2;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
break;
case 119:
gSaveContext.dayTime = 0x8000;
@ -1357,7 +1357,7 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm
}
break;
case 9:
gSaveContext.unk_1410 = 1;
gSaveContext.cutsceneTransitionControl = 1;
break;
case 10:
case 11:
@ -1371,7 +1371,7 @@ void Cutscene_Command_TransitionFX(PlayState* play, CutsceneContext* csCtx, CsCm
}
break;
case 12:
gSaveContext.unk_1410 = 255.0f - (155.0f * temp);
gSaveContext.cutsceneTransitionControl = 255.0f - (155.0f * temp);
break;
case 13:
play->envCtx.screenFillColor[0] = 0;

View file

@ -54,7 +54,7 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
return ((msg->byte0 & 1) == 1) ==
(CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST) != 0);
case (ELF_MSG_CONDITION_MAGIC << 4):
return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.magicAcquired) != 0);
return ((msg->byte0 & 1) == 1) == (((void)0, gSaveContext.isMagicAcquired) != 0);
}
}

View file

@ -51,16 +51,16 @@ void TransitionFade_Update(void* thisx, s32 updateRate) {
break;
case 1:
this->fadeTimer += updateRate;
if (this->fadeTimer >= gSaveContext.fadeDuration) {
this->fadeTimer = gSaveContext.fadeDuration;
if (this->fadeTimer >= gSaveContext.transFadeDuration) {
this->fadeTimer = gSaveContext.transFadeDuration;
this->isDone = 1;
}
if (!gSaveContext.fadeDuration) {
if (!gSaveContext.transFadeDuration) {
// "Divide by 0! Zero is included in ZCommonGet fade_speed"
osSyncPrintf(VT_COL(RED, WHITE) "0除算! ZCommonGet fade_speed に0がはいってる" VT_RST);
}
alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.fadeDuration);
alpha = (255.0f * this->fadeTimer) / ((void)0, gSaveContext.transFadeDuration);
this->fadeColor.a = (this->fadeDirection != 0) ? 255 - alpha : alpha;
break;
case 2:

View file

@ -67,14 +67,14 @@ void TransitionWipe_Update(void* thisx, s32 updateRate) {
u8 unk1419;
if (this->direction != 0) {
unk1419 = gSaveContext.unk_1419;
unk1419 = gSaveContext.transWipeSpeed;
this->texY += (unk1419 * 3) / updateRate;
if (this->texY >= 0x264) {
this->texY = 0x264;
this->isDone = 1;
}
} else {
unk1419 = gSaveContext.unk_1419;
unk1419 = gSaveContext.transWipeSpeed;
this->texY -= (unk1419 * 3) / updateRate;
if (this->texY < 0x14E) {
this->texY = 0x14D;

View file

@ -15,7 +15,7 @@ void KaleidoSetup_Update(PlayState* play) {
if (pauseCtx->state == 0 && pauseCtx->debugState == 0 && play->gameOverCtx.state == GAMEOVER_INACTIVE &&
play->sceneLoadFlag == 0 && play->transitionMode == 0 && gSaveContext.cutsceneIndex < 0xFFF0 &&
gSaveContext.nextCutsceneIndex < 0xFFF0 && !Play_InCsMode(play) &&
play->shootingGalleryStatus <= 1 && gSaveContext.unk_13F0 != 8 && gSaveContext.unk_13F0 != 9 &&
play->shootingGalleryStatus <= 1 && gSaveContext.magicState != 8 && gSaveContext.magicState != 9 &&
(play->sceneNum != SCENE_BOWLING || !Flags_GetSwitch(play, 0x38))) {
if (CVar_GetS32("gCheatEasyPauseBufferFrameAdvance", 0) == 2 && !CHECK_BTN_ALL(input->press.button, BTN_START)) {

View file

@ -295,7 +295,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
sLightningFlashAlpha = 0;
gSaveContext.unk_1410 = 0;
gSaveContext.cutsceneTransitionControl = 0;
envCtx->adjAmbientColor[0] = envCtx->adjAmbientColor[1] = envCtx->adjAmbientColor[2] = envCtx->adjLight1Color[0] =
envCtx->adjLight1Color[1] = envCtx->adjLight1Color[2] = envCtx->adjFogColor[0] = envCtx->adjFogColor[1] =
@ -326,7 +326,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
play->envCtx.unk_F2[0] = 0;
if (gSaveContext.unk_13C3 != 0) {
if (gSaveContext.retainWeatherMode != 0) {
if (((void)0, gSaveContext.sceneSetupIndex) < 4) {
switch (gWeatherMode) {
case 1:
@ -378,7 +378,7 @@ void Environment_Init(PlayState* play2, EnvironmentContext* envCtx, s32 unused)
D_8011FB38 = 0;
D_8011FB34 = 0;
gSkyboxBlendingEnabled = false;
gSaveContext.unk_13C3 = 0;
gSaveContext.retainWeatherMode = 0;
R_ENV_LIGHT1_DIR(0) = 80;
R_ENV_LIGHT1_DIR(1) = 80;
R_ENV_LIGHT1_DIR(2) = 80;
@ -2531,7 +2531,7 @@ void Environment_WarpSongLeave(PlayState* play) {
play->nextEntranceIndex = gSaveContext.respawn[RESPAWN_MODE_RETURN].entranceIndex;
play->sceneLoadFlag = 0x14;
play->fadeTransition = 3;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
switch (play->nextEntranceIndex) {
case 0x147:

View file

@ -2917,7 +2917,7 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
// "Recording complete"
osSyncPrintf("録音終了!!!!!!!!! message->info->status=%d \n",
msgCtx->ocarinaStaff->state);
gSaveContext.scarecrowCustomSongSet = true;
gSaveContext.scarecrowLongSongSet = true;
}
Audio_PlaySoundGeneral(NA_SE_SY_OCARINA_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
@ -2930,10 +2930,10 @@ void Message_DrawMain(PlayState* play, Gfx** p) {
osSyncPrintf("録音終了!!!!!!!!!録音終了\n");
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("\n====================================================================\n");
memcpy(gSaveContext.scarecrowCustomSong, gScarecrowCustomSongPtr,
sizeof(gSaveContext.scarecrowCustomSong));
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++) {
osSyncPrintf("%d, ", gSaveContext.scarecrowCustomSong[i]);
memcpy(gSaveContext.scarecrowLongSong, gScarecrowCustomSongPtr,
sizeof(gSaveContext.scarecrowLongSong));
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++) {
osSyncPrintf("%d, ", gSaveContext.scarecrowLongSong[i]);
}
osSyncPrintf(VT_RST);
osSyncPrintf("\n====================================================================\n");
@ -3310,7 +3310,7 @@ void Message_Draw(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx);
watchVar = gSaveContext.scarecrowCustomSongSet;
watchVar = gSaveContext.scarecrowLongSongSet;
Message_DrawDebugVariableChanged(&watchVar, play->state.gfxCtx);
if (BREG(0) != 0 && play->msgCtx.textId != 0) {
plusOne = Graph_GfxPlusOne(polyOpaP = POLY_OPA_DISP);

View file

@ -987,7 +987,7 @@ void func_80083108(PlayState* play) {
}
Interface_ChangeAlpha(50);
} else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & 0x00040000)) {
} else if ((player->stateFlags1 & 0x00200000) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
gSaveContext.buttonStatus[0] = BTN_DISABLED;
gSaveContext.buttonStatus[1] = BTN_DISABLED;
@ -2222,7 +2222,7 @@ u8 Item_Give(PlayState* play, u8 item) {
PerformAutosave(play, item);
return item;
} else if (item == ITEM_MAGIC_SMALL) {
if (gSaveContext.unk_13F0 != 10) {
if (gSaveContext.magicState != 10) {
if (play != NULL) {
Magic_Fill(play);
}
@ -2241,7 +2241,7 @@ u8 Item_Give(PlayState* play, u8 item) {
PerformAutosave(play, item);
return item;
} else if (item == ITEM_MAGIC_LARGE) {
if (gSaveContext.unk_13F0 != 10) {
if (gSaveContext.magicState != 10) {
if (play != NULL) {
Magic_Fill(play);
}
@ -2365,16 +2365,16 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
slot = SLOT(item);
if (item == RG_MAGIC_SINGLE) {
gSaveContext.magicAcquired = true;
gSaveContext.unk_13F6 = 0x30;
gSaveContext.isMagicAcquired = true;
gSaveContext.magicFillTarget = 0x30;
Magic_Fill(play);
return RG_NONE;
} else if (item == RG_MAGIC_DOUBLE) {
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;
Magic_Fill(play);
return RG_NONE;
@ -2389,7 +2389,7 @@ u16 Randomizer_Item_Give(PlayState* play, GetItemEntry giEntry) {
}
if (item == RG_DOUBLE_DEFENSE) {
gSaveContext.doubleDefense = true;
gSaveContext.isDoubleDefenseAcquired = true;
gSaveContext.inventory.defenseHearts = 20;
gSaveContext.healthAccumulator = 0x140;
return RG_NONE;
@ -3063,7 +3063,7 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) {
// clang-format off
if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &D_801333D4, 4,
&D_801333E0, &D_801333E0, &D_801333E8);
} else if ((gSaveContext.doubleDefense != 0) && (healthChange < 0)) {
} else if ((gSaveContext.isDoubleDefenseAcquired != 0) && (healthChange < 0)) {
healthChange >>= 1;
osSyncPrintf("ハート減少半分!!=%d\n", healthChange); // "Heart decrease halved!!%d"
}
@ -3220,29 +3220,29 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange) {
}
void Magic_Fill(PlayState* play) {
if (gSaveContext.magicAcquired) {
gSaveContext.unk_13F2 = gSaveContext.unk_13F0;
gSaveContext.unk_13F6 = (gSaveContext.doubleMagic + 1) * 0x30;
gSaveContext.unk_13F0 = 9;
if (gSaveContext.isMagicAcquired) {
gSaveContext.prevMagicState = gSaveContext.magicState;
gSaveContext.magicFillTarget = (gSaveContext.isDoubleMagicAcquired + 1) * 0x30;
gSaveContext.magicState = 9;
}
}
void func_800876C8(PlayState* play) {
if ((gSaveContext.unk_13F0 != 8) && (gSaveContext.unk_13F0 != 9)) {
if (gSaveContext.unk_13F0 == 10) {
gSaveContext.unk_13F2 = gSaveContext.unk_13F0;
if ((gSaveContext.magicState != 8) && (gSaveContext.magicState != 9)) {
if (gSaveContext.magicState == 10) {
gSaveContext.prevMagicState = gSaveContext.magicState;
}
gSaveContext.unk_13F0 = 5;
gSaveContext.magicState = 5;
}
}
s32 func_80087708(PlayState* play, s16 arg1, s16 arg2) {
if (!gSaveContext.magicAcquired) {
if (!gSaveContext.isMagicAcquired) {
return 0;
}
if ((arg2 != 5) && (gSaveContext.magic - arg1) < 0) {
if (gSaveContext.unk_13F4 != 0) {
if (gSaveContext.magicCapacity != 0) {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
return 0;
@ -3251,66 +3251,66 @@ s32 func_80087708(PlayState* play, s16 arg1, s16 arg2) {
switch (arg2) {
case 0:
case 2:
if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
if (gSaveContext.unk_13F0 == 7) {
if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) {
if (gSaveContext.magicState == 7) {
play->actorCtx.lensActive = false;
}
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 1;
gSaveContext.magicTarget = gSaveContext.magic - arg1;
gSaveContext.magicState = 1;
return 1;
} else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 1:
if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
if (gSaveContext.unk_13F0 == 7) {
if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) {
if (gSaveContext.magicState == 7) {
play->actorCtx.lensActive = false;
}
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 6;
gSaveContext.magicTarget = gSaveContext.magic - arg1;
gSaveContext.magicState = 6;
return 1;
} else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 3:
if (gSaveContext.unk_13F0 == 0) {
if (gSaveContext.magicState == 0) {
if (gSaveContext.magic != 0) {
play->interfaceCtx.unk_230 = 80;
gSaveContext.unk_13F0 = 7;
gSaveContext.magicState = 7;
return 1;
} else {
return 0;
}
} else {
if (gSaveContext.unk_13F0 == 7) {
if (gSaveContext.magicState == 7) {
return 1;
} else {
return 0;
}
}
case 4:
if ((gSaveContext.unk_13F0 == 0) || (gSaveContext.unk_13F0 == 7)) {
if (gSaveContext.unk_13F0 == 7) {
if ((gSaveContext.magicState == 0) || (gSaveContext.magicState == 7)) {
if (gSaveContext.magicState == 7) {
play->actorCtx.lensActive = false;
}
gSaveContext.unk_13F8 = gSaveContext.magic - arg1;
gSaveContext.unk_13F0 = 4;
gSaveContext.magicTarget = gSaveContext.magic - arg1;
gSaveContext.magicState = 4;
return 1;
} else {
Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
return 0;
}
case 5:
if (gSaveContext.unk_13F4 >= gSaveContext.magic) {
gSaveContext.unk_13F8 = gSaveContext.magic + arg1;
if (gSaveContext.magicCapacity >= gSaveContext.magic) {
gSaveContext.magicTarget = gSaveContext.magic + arg1;
if (gSaveContext.unk_13F8 >= gSaveContext.unk_13F4) {
gSaveContext.unk_13F8 = gSaveContext.unk_13F4;
if (gSaveContext.magicTarget >= gSaveContext.magicCapacity) {
gSaveContext.magicTarget = gSaveContext.magicCapacity;
}
gSaveContext.unk_13F0 = 10;
gSaveContext.magicState = 10;
return 1;
}
break;
@ -3359,23 +3359,23 @@ void Interface_UpdateMagicBar(PlayState* play) {
s16 borderChangeB;
s16 temp;
switch (gSaveContext.unk_13F0) {
switch (gSaveContext.magicState) {
case 8:
temp = gSaveContext.magicLevel * 0x30;
if (gSaveContext.unk_13F4 != temp) {
if (gSaveContext.unk_13F4 < temp) {
gSaveContext.unk_13F4 += 8;
if (gSaveContext.unk_13F4 > temp) {
gSaveContext.unk_13F4 = temp;
if (gSaveContext.magicCapacity != temp) {
if (gSaveContext.magicCapacity < temp) {
gSaveContext.magicCapacity += 8;
if (gSaveContext.magicCapacity > temp) {
gSaveContext.magicCapacity = temp;
}
} else {
gSaveContext.unk_13F4 -= 8;
if (gSaveContext.unk_13F4 <= temp) {
gSaveContext.unk_13F4 = temp;
gSaveContext.magicCapacity -= 8;
if (gSaveContext.magicCapacity <= temp) {
gSaveContext.magicCapacity = temp;
}
}
} else {
gSaveContext.unk_13F0 = 9;
gSaveContext.magicState = 9;
}
break;
@ -3388,31 +3388,31 @@ void Interface_UpdateMagicBar(PlayState* play) {
}
// "Storage MAGIC_NOW=%d (%d)"
osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.unk_13F6);
if (gSaveContext.magic >= gSaveContext.unk_13F6) {
gSaveContext.magic = gSaveContext.unk_13F6;
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;
gSaveContext.unk_13F2 = 0;
osSyncPrintf("蓄電 MAGIC_NOW=%d (%d)\n", gSaveContext.magic, gSaveContext.magicFillTarget);
if (gSaveContext.magic >= gSaveContext.magicFillTarget) {
gSaveContext.magic = gSaveContext.magicFillTarget;
gSaveContext.magicState = gSaveContext.prevMagicState;
gSaveContext.prevMagicState = 0;
}
break;
case 1:
sMagicBorderRatio = 2;
gSaveContext.unk_13F0 = 2;
gSaveContext.magicState = 2;
break;
case 2:
gSaveContext.magic -= 2;
if (gSaveContext.magic <= 0) {
gSaveContext.magic = 0;
gSaveContext.unk_13F0 = 3;
gSaveContext.magicState = 3;
if (CVar_GetS32("gHudColors", 1) == 2) {
sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori);
} else {
sMagicBorder = sMagicBorder_ori;
}
} else if (gSaveContext.magic == gSaveContext.unk_13F8) {
gSaveContext.unk_13F0 = 3;
} else if (gSaveContext.magic == gSaveContext.magicTarget) {
gSaveContext.magicState = 3;
if (CVar_GetS32("gHudColors", 1) == 2) {
sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori);
} else {
@ -3464,7 +3464,7 @@ void Interface_UpdateMagicBar(PlayState* play) {
} else {
sMagicBorder = sMagicBorder_ori;
}
gSaveContext.unk_13F0 = 0;
gSaveContext.magicState = 0;
break;
case 7:
@ -3484,7 +3484,7 @@ void Interface_UpdateMagicBar(PlayState* play) {
play->actorCtx.lensActive = false;
Audio_PlaySoundGeneral(NA_SE_SY_GLASSMODE_OFF, &D_801333D4, 4, &D_801333E0, &D_801333E0,
&D_801333E8);
gSaveContext.unk_13F0 = 0;
gSaveContext.magicState = 0;
if (CVar_GetS32("gHudColors", 1) == 2) {
sMagicBorder = CVar_GetRGB("gCCMagicBorderNormPrim", sMagicBorder_ori);
} else {
@ -3539,15 +3539,15 @@ void Interface_UpdateMagicBar(PlayState* play) {
case 10:
gSaveContext.magic += 4;
Audio_PlaySoundGeneral(NA_SE_SY_GAUGE_UP - SFX_FLAG, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
if (gSaveContext.magic >= gSaveContext.unk_13F8) {
gSaveContext.magic = gSaveContext.unk_13F8;
gSaveContext.unk_13F0 = gSaveContext.unk_13F2;
gSaveContext.unk_13F2 = 0;
if (gSaveContext.magic >= gSaveContext.magicTarget) {
gSaveContext.magic = gSaveContext.magicTarget;
gSaveContext.magicState = gSaveContext.prevMagicState;
gSaveContext.prevMagicState = 0;
}
break;
default:
gSaveContext.unk_13F0 = 0;
gSaveContext.magicState = 0;
break;
}
}
@ -3663,13 +3663,13 @@ void Interface_DrawMagicBar(PlayState* play) {
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterEndTex, 8, 16, PosX_Start, magicBarY, 8, 16, 1 << 10, 1 << 10);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, PosX_MidEnd, magicBarY, gSaveContext.unk_13F4, 16, 1 << 10, 1 << 10);
OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gMagicMeterMidTex, 24, 16, PosX_MidEnd, magicBarY, gSaveContext.magicCapacity, 16, 1 << 10, 1 << 10);
gDPLoadTextureBlock(OVERLAY_DISP++, gMagicMeterEndTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 16, 0,
G_TX_MIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 3, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.unk_13F4) + 8) << 2, magicBarY << 2,
((rMagicBarX + gSaveContext.unk_13F4) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE,
gSPWideTextureRectangle(OVERLAY_DISP++, ((rMagicBarX + gSaveContext.magicCapacity) + 8) << 2, magicBarY << 2,
((rMagicBarX + gSaveContext.magicCapacity) + 16) << 2, (magicBarY + 16) << 2, G_TX_RENDERTILE,
256, 0, 1 << 10, 1 << 10);
gDPPipeSync(OVERLAY_DISP++);
@ -3677,7 +3677,7 @@ void Interface_DrawMagicBar(PlayState* play) {
ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255);
if (gSaveContext.unk_13F0 == 4) {
if (gSaveContext.magicState == 4) {
// Yellow part of the bar indicating the amount of magic to be subtracted
if (CVar_GetS32("gHudColors", 1) == 2) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).r, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).g, CVar_GetRGB("gCCMagicUsePrim", magicbar_yellow).b, interfaceCtx->magicAlpha);
@ -3702,7 +3702,7 @@ void Interface_DrawMagicBar(PlayState* play) {
}
gSPWideTextureRectangle(OVERLAY_DISP++, rMagicFillX << 2, (magicBarY + 3) << 2,
(rMagicFillX + gSaveContext.unk_13F8) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE,
(rMagicFillX + gSaveContext.magicTarget) << 2, (magicBarY + 10) << 2, G_TX_RENDERTILE,
0, 0, 1 << 10, 1 << 10);
} else {
// Fill the whole bar with the normal magic color
@ -4164,7 +4164,7 @@ void Interface_DrawItemButtons(PlayState* play) {
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
temp = 0;
} else if ((player->stateFlags1 & 0x00200000) || (func_8008F2F8(play) == 4) ||
(player->stateFlags2 & 0x00040000)) {
(player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
temp = 70;
} else {
temp = interfaceCtx->healthAlpha;
@ -5194,7 +5194,7 @@ void Interface_Draw(PlayState* play) {
Interface_DrawLineupTick(play);
}
if (fullUi || gSaveContext.unk_13F0 > 0) {
if (fullUi || gSaveContext.magicState > 0) {
Interface_DrawMagicBar(play);
}
@ -6367,15 +6367,15 @@ void Interface_Update(PlayState* play) {
(msgCtx->msgMode == MSGMODE_NONE) && (play->sceneLoadFlag == 0) &&
(play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionMode == 0) &&
((play->csCtx.state == CS_STATE_IDLE) || !Player_InCsMode(play))) {
if ((gSaveContext.magicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
gSaveContext.magicLevel = gSaveContext.doubleMagic + 1;
gSaveContext.unk_13F0 = 8;
if ((gSaveContext.isMagicAcquired != 0) && (gSaveContext.magicLevel == 0)) {
gSaveContext.magicLevel = gSaveContext.isDoubleMagicAcquired + 1;
gSaveContext.magicState = 8;
osSyncPrintf(VT_FGCOL(YELLOW));
osSyncPrintf("魔法スター─────ト!!!!!!!!!\n"); // "Magic Start!!!!!!!!!"
osSyncPrintf("MAGIC_MAX=%d\n", gSaveContext.magicLevel);
osSyncPrintf("MAGIC_NOW=%d\n", gSaveContext.magic);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.unk_13F6);
osSyncPrintf("Z_MAGIC_NOW_MAX=%d\n", gSaveContext.unk_13F4);
osSyncPrintf("Z_MAGIC_NOW_NOW=%d\n", gSaveContext.magicFillTarget);
osSyncPrintf("Z_MAGIC_NOW_MAX=%d\n", gSaveContext.magicCapacity);
osSyncPrintf(VT_RST);
}
@ -6463,18 +6463,18 @@ void Interface_Update(PlayState* play) {
if ((gSaveContext.dayTime >= 0x4555) && (gSaveContext.dayTime < 0xC001)) {
gSaveContext.nextDayTime = 0;
play->fadeTransition = 4;
gSaveContext.nextTransition = 2;
gSaveContext.nextTransitionType = 2;
play->unk_11DE9 = 1;
} else {
gSaveContext.nextDayTime = 0x8001;
play->fadeTransition = 5;
gSaveContext.nextTransition = 3;
gSaveContext.nextTransitionType = 3;
play->unk_11DE9 = 1;
}
if (play->sceneNum == SCENE_SPOT13) {
play->fadeTransition = 14;
gSaveContext.nextTransition = 14;
gSaveContext.nextTransitionType = 14;
}
gSaveContext.respawnFlag = -2;

View file

@ -214,7 +214,7 @@ void GivePlayerRandoRewardSongOfTime(PlayState* play, RandomizerCheck check) {
Player* player = GET_PLAYER(play);
if (gSaveContext.entranceIndex == 0x050F && player != NULL && !Player_InBlockingCsMode(play, player) &&
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransition == 0xFF && !gSaveContext.pendingIceTrapCount) {
!Flags_GetTreasure(play, 0x1F) && gSaveContext.nextTransitionType == 0xFF && !gSaveContext.pendingIceTrapCount) {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(check, RG_SONG_OF_TIME);
GiveItemEntryWithoutActor(play, getItemEntry);
player->pendingFlag.flagID = 0x1F;
@ -556,7 +556,7 @@ void Play_Init(GameState* thisx) {
if (CVar_GetS32("gSceneTransitions", 255)!= 255){
play->transitionMode = CVar_GetS32("gSceneTransitions", 0);
gSaveContext.nextTransition = CVar_GetS32("gSceneTransitions", 0);
gSaveContext.nextTransitionType = CVar_GetS32("gSceneTransitions", 0);
play->fadeTransition = CVar_GetS32("gSceneTransitions", 0);
}
@ -571,12 +571,12 @@ void Play_Init(GameState* thisx) {
play->unk_11DE9 = 0;
if (gSaveContext.gameMode != 1) {
if (gSaveContext.nextTransition == 0xFF) {
if (gSaveContext.nextTransitionType == 0xFF) {
play->fadeTransition =
(gEntranceTable[((void)0, gSaveContext.entranceIndex) + tempSetupIndex].field >> 7) & 0x7F; // Fade In
} else {
play->fadeTransition = gSaveContext.nextTransition;
gSaveContext.nextTransition = 0xFF;
play->fadeTransition = gSaveContext.nextTransitionType;
gSaveContext.nextTransitionType = 0xFF;
}
} else {
play->fadeTransition = 6;
@ -777,21 +777,21 @@ void Play_Update(PlayState* play) {
play->transitionCtx.transitionType | 0x80);
}
gSaveContext.unk_1419 = 14;
gSaveContext.transWipeSpeed = 14;
if ((play->transitionCtx.transitionType == 8) ||
(play->transitionCtx.transitionType == 9)) {
gSaveContext.unk_1419 = 28;
gSaveContext.transWipeSpeed = 28;
}
gSaveContext.fadeDuration = 60;
gSaveContext.transFadeDuration = 60;
if ((play->transitionCtx.transitionType == 4) ||
(play->transitionCtx.transitionType == 5)) {
gSaveContext.fadeDuration = 20;
gSaveContext.transFadeDuration = 20;
} else if ((play->transitionCtx.transitionType == 6) ||
(play->transitionCtx.transitionType == 7)) {
gSaveContext.fadeDuration = 150;
gSaveContext.transFadeDuration = 150;
} else if (play->transitionCtx.transitionType == 17) {
gSaveContext.fadeDuration = 2;
gSaveContext.transFadeDuration = 2;
}
if ((play->transitionCtx.transitionType == 3) ||
@ -954,7 +954,7 @@ void Play_Update(PlayState* play) {
break;
case 11:
if (gSaveContext.unk_1410 != 0) {
if (gSaveContext.cutsceneTransitionControl != 0) {
play->transitionMode = 3;
}
break;
@ -1029,9 +1029,9 @@ void Play_Update(PlayState* play) {
break;
case 17:
if (gSaveContext.unk_1410 != 0) {
play->envCtx.screenFillColor[3] = gSaveContext.unk_1410;
if (gSaveContext.unk_1410 < 0x65) {
if (gSaveContext.cutsceneTransitionControl != 0) {
play->envCtx.screenFillColor[3] = gSaveContext.cutsceneTransitionControl;
if (gSaveContext.cutsceneTransitionControl < 0x65) {
gTrnsnUnkState = 0;
R_UPDATE_RATE = 3;
play->sceneLoadFlag = 0;
@ -2177,11 +2177,11 @@ void Play_PerformSave(PlayState* play) {
gSaveContext.savedSceneNum = play->sceneNum;
if (gSaveContext.temporaryWeapon) {
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
GET_PLAYER(play)->currentSwordItem = ITEM_NONE;
GET_PLAYER(play)->currentSwordItemId = ITEM_NONE;
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE);
Save_SaveFile();
gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI;
GET_PLAYER(play)->currentSwordItem = ITEM_SWORD_KOKIRI;
GET_PLAYER(play)->currentSwordItemId = ITEM_SWORD_KOKIRI;
Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI);
} else {
Save_SaveFile();

View file

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

View file

@ -217,14 +217,14 @@ void Sram_OpenSave() {
gSaveContext.health = 0x30;
}
if (gSaveContext.scarecrowCustomSongSet) {
if (gSaveContext.scarecrowLongSongSet) {
osSyncPrintf(VT_FGCOL(BLUE));
osSyncPrintf("\n====================================================================\n");
memcpy(gScarecrowCustomSongPtr, gSaveContext.scarecrowCustomSong, sizeof(gSaveContext.scarecrowCustomSong));
memcpy(gScarecrowCustomSongPtr, gSaveContext.scarecrowLongSong, sizeof(gSaveContext.scarecrowLongSong));
ptr = (u8*)gScarecrowCustomSongPtr;
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowCustomSong); i++, ptr++) {
for (i = 0; i < ARRAY_COUNT(gSaveContext.scarecrowLongSong); i++, ptr++) {
osSyncPrintf("%d, ", *ptr);
}

View file

@ -604,7 +604,7 @@ void Skybox_Setup(PlayState* play, SkyboxContext* skyboxCtx, s16 skyboxId) {
{
case SKYBOX_NORMAL_SKY:
phi_v1 = 0;
if (gSaveContext.unk_13C3 != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 &&
if (gSaveContext.retainWeatherMode != 0 && gSaveContext.sceneSetupIndex < 4 && gWeatherMode > 0 &&
gWeatherMode < 6) {
phi_v1 = 1;
}

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;