Full health spawn (#2377)

* full health spawn

Co-authored-by: MoriyaFaith <46070717+MoriyaFaith@users.noreply.github.com>

* add enahancement to gamemenubar, update to use new cvar method names, simplify save loading logic so loading a save with less than 3 hearts spawns with full hearts with enhancement enabled instead of spawing with 3

* formatting

Co-authored-by: MoriyaFaith <46070717+MoriyaFaith@users.noreply.github.com>
This commit is contained in:
briaguya 2023-01-21 09:36:35 -05:00 committed by GitHub
parent 4291ec8252
commit a9e7faa180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 2 deletions

View File

@ -86,6 +86,7 @@ const std::vector<const char*> enhancementsCvars = {
"gNoHeartDrops",
"gBombchuDrops",
"gGoronPot",
"gFullHealthSpawn",
"gDampeWin",
"gRedPotionEffect",
"gRedPotionHealth",

View File

@ -443,6 +443,8 @@ namespace GameMenuBar {
32x: Can survive void damage with max health and double defense\n\
64x: Cannot survive void damage"
);
UIWidgets::PaddedEnhancementCheckbox("Spawn with full health", "gFullHealthSpawn", true, false);
UIWidgets::Tooltip("Respawn with full health instead of 3 Hearts");
UIWidgets::PaddedEnhancementCheckbox("No Random Drops", "gNoRandomDrops", true, false);
UIWidgets::Tooltip("Disables random drops, except from the Goron Pot, Dampe, and bosses");
bool forceEnableBombchuDrops = gSaveContext.n64ddFlag &&

View File

@ -207,7 +207,7 @@ void Sram_OpenSave() {
osSyncPrintf(VT_RST);
if (gSaveContext.health < 0x30) {
gSaveContext.health = 0x30;
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
}
if (gSaveContext.scarecrowLongSongSet) {

View File

@ -4158,7 +4158,7 @@ void KaleidoScope_Update(PlayState* play)
Grotto_ForceGrottoReturn();
}
gSaveContext.nextTransitionType = 2;
gSaveContext.health = 0x30;
gSaveContext.health = CVarGetInteger("gFullHealthSpawn", 0) ? gSaveContext.healthCapacity : 0x30;
Audio_QueueSeqCmd(0xF << 28 | SEQ_PLAYER_BGM_MAIN << 24 | 0xA);
gSaveContext.healthAccumulator = 0;
gSaveContext.magicState = 0;