[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;
}