Merge branch 'develop' of github.com:Malkierian/Shipwright into reindeer-games

This commit is contained in:
Malkierian
2025-12-03 09:14:56 -07:00
66 changed files with 977 additions and 473 deletions
+1
View File
@@ -1677,6 +1677,7 @@ void func_800ED458(s32 arg0) {
} else if ((sPrevOcarinaNoteVal != 0xFF) && (sCurOcarinaBtnVal == 0xFF)) {
Audio_StopSfxById(NA_SE_OC_OCARINA);
}
GameInteractor_ExecuteOnOcarinaNote(sCurOcarinaBtnVal, D_80130F24, D_80130F10);
}
}
+1 -1
View File
@@ -1707,7 +1707,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP
}
if (dropId == ITEM00_FLEXIBLE) {
if (gSaveContext.health <= 0x10) { // 1 heart or less
if (gSaveContext.health <= FULL_HEART_HEALTH) { // 1 heart or less
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0,
FAIRY_HEAL_TIMED, true);
EffectSsDeadSound_SpawnStationary(play, spawnPos, NA_SE_EV_BUTTERFRY_TO_FAIRY, true,
+4 -4
View File
@@ -393,9 +393,9 @@ void HealthMeter_Draw(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
GraphicsContext* gfxCtx = play->state.gfxCtx;
Vtx* sp154 = interfaceCtx->beatingHeartVtx;
s32 curHeartFraction = gSaveContext.health % 0x10;
s16 totalHeartCount = gSaveContext.healthCapacity / 0x10;
s16 fullHeartCount = gSaveContext.health / 0x10;
s32 curHeartFraction = gSaveContext.health % FULL_HEART_HEALTH;
s16 totalHeartCount = gSaveContext.healthCapacity / FULL_HEART_HEALTH;
s16 fullHeartCount = gSaveContext.health / FULL_HEART_HEALTH;
s32 pad2;
f32 sp144 = interfaceCtx->unk_22A * 0.1f;
s32 curCombineModeSet = 0;
@@ -410,7 +410,7 @@ void HealthMeter_Draw(PlayState* play) {
OPEN_DISPS(gfxCtx);
if (!(gSaveContext.health % 0x10)) {
if (!(gSaveContext.health % FULL_HEART_HEALTH)) {
fullHeartCount--;
}
+4 -7
View File
@@ -4656,7 +4656,7 @@ void Message_Update(PlayState* play) {
}
if ((msgCtx->textId >= 0xC2 && msgCtx->textId < 0xC7) ||
(msgCtx->textId >= 0xFA && msgCtx->textId < 0xFE)) {
gSaveContext.healthAccumulator = 0x140; // Refill 20 hearts
gSaveContext.healthAccumulator = MAX_HEALTH; // Refill 20 hearts
}
if (msgCtx->textId == 0x301F || msgCtx->textId == 0xA || msgCtx->textId == 0xC || msgCtx->textId == 0xCF ||
msgCtx->textId == 0x21C || msgCtx->textId == 9 || msgCtx->textId == 0x4078 ||
@@ -4694,12 +4694,9 @@ void Message_Update(PlayState* play) {
}
if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) {
gSaveContext.inventory.questItems ^= 0x40000000;
if (!CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)) {
gSaveContext.healthCapacity += 0x10;
gSaveContext.health += 0x10;
} else {
gSaveContext.healthCapacity -= 0x10;
gSaveContext.health -= 0x10;
if (GameInteractor_Should(VB_HEARTS_INCREASE_WITH_CONTAINERS, true)) {
gSaveContext.healthCapacity += FULL_HEART_HEALTH;
gSaveContext.health += FULL_HEART_HEALTH;
}
}
if (msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE) {
+6 -9
View File
@@ -2325,19 +2325,16 @@ u8 Item_Give(PlayState* play, u8 item) {
gSaveContext.ship.stats.heartPieces++;
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if (item == ITEM_HEART_CONTAINER) {
if (!CVarGetInteger(CVAR_ENHANCEMENT("HurtContainer"), 0)) {
gSaveContext.healthCapacity += 0x10;
gSaveContext.health += 0x10;
} else {
gSaveContext.healthCapacity -= 0x10;
gSaveContext.health -= 0x10;
if (GameInteractor_Should(VB_HEARTS_INCREASE_WITH_CONTAINERS, true)) {
gSaveContext.healthCapacity += FULL_HEART_HEALTH;
gSaveContext.health += FULL_HEART_HEALTH;
}
gSaveContext.ship.stats.heartContainers++;
return Return_Item(item, MOD_NONE, ITEM_NONE);
} else if (item == ITEM_HEART) {
osSyncPrintf("回復ハート回復ハート回復ハート\n"); // "Recovery Heart"
if (play != NULL) {
Health_ChangeBy(play, 0x10);
Health_ChangeBy(play, FULL_HEART_HEALTH);
}
return Return_Item(item, MOD_NONE, item);
} else if (item == ITEM_MAGIC_SMALL) {
@@ -2917,7 +2914,7 @@ s32 Health_ChangeBy(PlayState* play, s16 healthChange) {
gSaveContext.health = gSaveContext.healthCapacity;
}
heartCount = gSaveContext.health % 0x10;
heartCount = gSaveContext.health % FULL_HEART_HEALTH;
healthLevel = heartCount;
if (heartCount != 0) {
@@ -3574,7 +3571,7 @@ void Interface_DrawMagicBar(PlayState* play) {
R_MAGIC_FILL_X - 1;
}
} else {
if ((gSaveContext.healthCapacity - 1) / 0x10 >= lineLength && lineLength != 0) {
if ((gSaveContext.healthCapacity - 1) / FULL_HEART_HEALTH >= lineLength && lineLength != 0) {
magicBarY =
magicBarY_original_l +
magicDrop * (lineLength == 0 ? 0 : ((gSaveContext.healthCapacity - 1) / (0x10 * lineLength) - 1));
+4 -1
View File
@@ -7,6 +7,7 @@
#include "overlays/actors/ovl_Demo_Effect/z_demo_effect.h"
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "soh/Enhancements/randomizer/draw.h"
#include "soh/Enhancements/Holiday/Fredomato.h"
#include "soh/ResourceManagerHelpers.h"
@@ -1087,7 +1088,9 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL
color = &sTemp;
}
gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0);
if (GameInteractor_Should(VB_APPLY_TUNIC_COLOR, true, data, color)) {
gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0);
}
// If we have a custom link model, always use the most detailed LOD
if (Player_IsCustomLinkModel()) {
+2 -2
View File
@@ -151,9 +151,9 @@ void Sram_OpenSave() {
osSyncPrintf("scene_no = %d\n", gSaveContext.entranceIndex);
osSyncPrintf(VT_RST);
if (gSaveContext.health < 0x30) {
if (gSaveContext.health < STARTING_HEALTH) {
gSaveContext.health =
CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0) ? gSaveContext.healthCapacity : 0x30;
CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0) ? gSaveContext.healthCapacity : STARTING_HEALTH;
}
if (gSaveContext.scarecrowLongSongSet) {
@@ -475,7 +475,7 @@ void BgDyYoseizo_HealPlayer_NoReward(BgDyYoseizo* this, PlayState* play) {
}
if (this->healingTimer == 110) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
Magic_Fill(play);
this->refillTimer = 200;
}
@@ -743,7 +743,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
}
if (!this->healing) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
this->healing = true;
if (actionIndex == 2) {
Magic_Fill(play);
@@ -771,7 +771,7 @@ void BgDyYoseizo_Give_Reward(BgDyYoseizo* this, PlayState* play) {
}
this->itemSpawned = true;
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
Interface_ChangeAlpha(9);
gSaveContext.itemGetInf[1] |= sItemGetFlags[actionIndex];
Item_Give(play, sItemIds[actionIndex]);
@@ -586,7 +586,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
this->unk_198 = 2;
this->timers[2] = 110;
if (GameInteractor_Should(VB_GANON_HEAL_BEFORE_FIGHT, true)) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
}
Audio_QueueSeqCmd(NA_BGM_STOP);
} else {
@@ -802,7 +802,7 @@ void BossGanon_IntroCutscene(BossGanon* this, PlayState* play) {
}
if (this->csTimer == 25) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
}
if (this->csTimer == 100) {
@@ -206,7 +206,7 @@ void EnBomBowlPit_Reset(EnBomBowlPit* this, PlayState* play) {
// "Normal termination"/"completion"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST);
if (this->getItemId == GI_HEART_PIECE) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
// "Ah recovery!" (?)
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ あぁ回復! ☆☆☆☆☆ \n" VT_RST);
}
@@ -9517,7 +9517,7 @@ void func_80843AE8(PlayState* play, Player* this) {
LinkAnimation_Change(play, &this->skelAnime, &gPlayerAnim_link_derth_rebirth, 1.0f, 99.0f,
Animation_GetLastFrame(&gPlayerAnim_link_derth_rebirth), ANIMMODE_ONCE, 0.0f);
}
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
this->av2.actionVar2 = -1;
}
} else if (gSaveContext.healthAccumulator == 0) {
@@ -14599,20 +14599,20 @@ void Player_Action_8084EAC0(Player* this, PlayState* play) {
rand = 3;
}
if ((rand < 0) && (gSaveContext.health <= 0x10)) {
if ((rand < 0) && (gSaveContext.health <= FULL_HEART_HEALTH)) {
rand = 3;
}
if (rand < 0) {
Health_ChangeBy(play, -0x10);
Health_ChangeBy(play, -FULL_HEART_HEALTH);
} else {
gSaveContext.healthAccumulator = rand * 0x10;
gSaveContext.healthAccumulator = rand * FULL_HEART_HEALTH;
}
} else {
s32 sp28 = D_808549FC[this->itemAction - PLAYER_IA_BOTTLE_POTION_RED];
if (sp28 & 1) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
}
if (sp28 & 2) {
@@ -14756,7 +14756,7 @@ void Player_Action_8084EED8(Player* this, PlayState* play) {
Player_PlaySfx(this, NA_SE_EV_BOTTLE_CAP_OPEN);
Player_PlaySfx(this, NA_SE_EV_FIATY_HEAL - SFX_FLAG);
} else if (LinkAnimation_OnFrame(&this->skelAnime, 47.0f)) {
gSaveContext.healthAccumulator = 0x140;
gSaveContext.healthAccumulator = MAX_HEALTH;
}
}
@@ -2401,7 +2401,7 @@ void FileChoose_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) {
gDPSetEnvColor(POLY_OPA_DISP++, heartBorder.r, heartBorder.g, heartBorder.b, 255);
}
i = Save_GetSaveMetaInfo(fileIndex)->healthCapacity / 0x10;
i = Save_GetSaveMetaInfo(fileIndex)->healthCapacity / FULL_HEART_HEALTH;
if (CVarGetInteger(CVAR_ENHANCEMENT("FileSelectMoreInfo"), 0) == 0 || this->menuMode != FS_MENU_MODE_SELECT ||
Save_GetSaveMetaInfo(this->selectedFileIndex)->archiSave) {
@@ -50,6 +50,8 @@ void Select_LoadGame(SelectContext* this, s32 entranceIndex) {
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenCurrentScene"), this->currentScene);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenTopDisplayedScene"), this->topDisplayedScene);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenPageDownIndex"), this->pageDownIndex);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenLinkAge"), gSaveContext.linkAge);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenNightFlag"), gSaveContext.nightFlag);
CVarSave();
if (ResourceMgr_GameHasMasterQuest() && ResourceMgr_GameHasOriginal()) {
@@ -118,6 +120,8 @@ void Select_Grotto_LoadGame(SelectContext* this, s32 grottoIndex) {
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenCurrentScene"), this->currentScene);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenTopDisplayedScene"), this->topDisplayedScene);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenPageDownIndex"), this->pageDownIndex);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenLinkAge"), gSaveContext.linkAge);
CVarSetInteger(CVAR_GENERAL("BetterDebugWarpScreenNightFlag"), gSaveContext.nightFlag);
CVarSave();
}
@@ -1833,6 +1837,10 @@ void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode) {
this->opt = 1;
}
}
gSaveContext.linkAge = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenLinkAge"), 1);
gSaveContext.nightFlag = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenNightFlag"), 0);
gSaveContext.dayTime = gSaveContext.nightFlag ? 0x0000 : 0x8000;
} else {
this->count = ARRAY_COUNT(sScenes);
@@ -140,7 +140,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 0);
// Current Health Quarter (X / 4)
KaleidoScope_DrawDigit(play, (gSaveContext.health % 0x10) / 4, 194, 15);
KaleidoScope_DrawDigit(play, (gSaveContext.health % FULL_HEART_HEALTH) / 4, 194, 15);
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, 255);
@@ -169,7 +169,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Health capacity
spD8[2] = 0;
spD8[3] = gSaveContext.healthCapacity / 0x10;
spD8[3] = gSaveContext.healthCapacity / FULL_HEART_HEALTH;
while (spD8[3] >= 10) {
spD8[2]++;
spD8[3] -= 10;
@@ -180,7 +180,7 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
// Health
spD8[2] = 0;
spD8[3] = gSaveContext.health / 0x10;
spD8[3] = gSaveContext.health / FULL_HEART_HEALTH;
while (spD8[3] >= 10) {
spD8[2]++;
spD8[3] -= 10;
@@ -368,15 +368,15 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
case 1:
if (CHECK_BTN_ALL(input->press.button, BTN_CUP) || CHECK_BTN_ALL(input->press.button, BTN_CLEFT)) {
gSaveContext.healthCapacity -= 0x10;
if (gSaveContext.healthCapacity < 0x30) {
gSaveContext.healthCapacity = 0x30;
gSaveContext.healthCapacity -= FULL_HEART_HEALTH;
if (gSaveContext.healthCapacity < STARTING_HEALTH) {
gSaveContext.healthCapacity = STARTING_HEALTH;
}
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN) ||
CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
gSaveContext.healthCapacity += 0x10;
if (gSaveContext.healthCapacity >= 0x140) {
gSaveContext.healthCapacity = 0x140;
gSaveContext.healthCapacity += FULL_HEART_HEALTH;
if (gSaveContext.healthCapacity >= MAX_HEALTH) {
gSaveContext.healthCapacity = MAX_HEALTH;
}
}
break;
@@ -387,9 +387,9 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
} else if (CHECK_BTN_ALL(input->press.button, BTN_CRIGHT)) {
Health_ChangeBy(play, 4);
} else if (CHECK_BTN_ALL(input->press.button, BTN_CUP)) {
Health_ChangeBy(play, -0x10);
Health_ChangeBy(play, -FULL_HEART_HEALTH);
} else if (CHECK_BTN_ALL(input->press.button, BTN_CDOWN)) {
Health_ChangeBy(play, 0x10);
Health_ChangeBy(play, FULL_HEART_HEALTH);
}
break;
@@ -1633,8 +1633,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (pauseCtx->randoQuestMode) {
POLY_OPA_DISP =
KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx, sSaveTexs[gSaveContext.language]);
POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx, sGameOverTexs);
RandoKaleido_DrawMiscCollectibles(play);
} else {
POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->questPageVtx,
@@ -1729,8 +1728,7 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
if (pauseCtx->randoQuestMode) {
POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx,
sSaveTexs[gSaveContext.language]);
POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->saveVtx, sGameOverTexs);
RandoKaleido_DrawMiscCollectibles(play);
} else {
POLY_OPA_DISP = KaleidoScope_DrawPageSections(POLY_OPA_DISP, pauseCtx->questPageVtx,
@@ -4773,8 +4771,9 @@ void KaleidoScope_Update(PlayState* play) {
// Reset frame counter to prevent autosave on respawn
play->gameplayFrames = 0;
gSaveContext.nextTransitionType = TRANS_TYPE_FADE_BLACK;
gSaveContext.health =
CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0) ? gSaveContext.healthCapacity : 0x30;
gSaveContext.health = CVarGetInteger(CVAR_ENHANCEMENT("FullHealthSpawn"), 0)
? gSaveContext.healthCapacity
: STARTING_HEALTH;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = MAGIC_STATE_IDLE;