From 695ab6c6ee2d7df46096679ab440f8cc0817f045 Mon Sep 17 00:00:00 2001 From: Caladius Date: Thu, 1 Feb 2024 20:57:12 -0500 Subject: Hurt Container Mode (#3336) * Each Heart Container or full Heart Piece reduces Links hearts by 1 * Based on Briaguya's suggested Code but modified slightly as some parts were missing. * Static Bool * The episode without Captain Hook's Hook --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: Garrett Cox --- soh/src/code/z_message_PAL.c | 9 +++++++-- soh/src/code/z_parameter.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'soh/src/code') diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 7bb3803fc..4c661aad7 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -3361,8 +3361,13 @@ void Message_Update(PlayState* play) { } if ((s32)(gSaveContext.inventory.questItems & 0xF0000000) == 0x40000000) { gSaveContext.inventory.questItems ^= 0x40000000; - gSaveContext.healthCapacity += 0x10; - gSaveContext.health += 0x10; + if (!CVarGetInteger("gHurtContainer", 0)) { + gSaveContext.healthCapacity += 0x10; + gSaveContext.health += 0x10; + } else { + gSaveContext.healthCapacity -= 0x10; + gSaveContext.health -= 0x10; + } } if (msgCtx->ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE) { if (sLastPlayedSong == OCARINA_SONG_SARIAS) { diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index f9a54eb2c..6efa962b6 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -2278,8 +2278,13 @@ u8 Item_Give(PlayState* play, u8 item) { gSaveContext.sohStats.heartPieces++; return Return_Item(item, MOD_NONE, ITEM_NONE); } else if (item == ITEM_HEART_CONTAINER) { - gSaveContext.healthCapacity += 0x10; - gSaveContext.health += 0x10; + if (!CVarGetInteger("gHurtContainer", 0)) { + gSaveContext.healthCapacity += 0x10; + gSaveContext.health += 0x10; + } else { + gSaveContext.healthCapacity -= 0x10; + gSaveContext.health -= 0x10; + } gSaveContext.sohStats.heartContainers++; return Return_Item(item, MOD_NONE, ITEM_NONE); } else if (item == ITEM_HEART) { -- cgit v1.2.3