summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorCaladius <Caladius@users.noreply.github.com>2024-02-01 20:57:12 -0500
committerGitHub <noreply@github.com>2024-02-01 19:57:12 -0600
commit695ab6c6ee2d7df46096679ab440f8cc0817f045 (patch)
tree9d5215387f8c7a4a3dc02c8f3f7472a8ecb062ed /soh/src/code
parentbe948339b965d76337bbec66563e7aabbcf489c1 (diff)
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 <garrettjcox@gmail.com>
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_message_PAL.c9
-rw-r--r--soh/src/code/z_parameter.c9
2 files changed, 14 insertions, 4 deletions
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) {