From 4992a3565f27a572fa551a238a303e0144edcc20 Mon Sep 17 00:00:00 2001 From: TriumphantBass <32756996+TriumphantBass@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:29:41 -0700 Subject: [PATCH] Fix setting the IsVileteSaved flag on non-randomized boss runs --- TsRandomizer/LevelObjects/RoomTriggers.cs | 9 +++++---- TsRandomizer/Screens/GameplayScreen.cs | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TsRandomizer/LevelObjects/RoomTriggers.cs b/TsRandomizer/LevelObjects/RoomTriggers.cs index af19b77b..8ac0c9a0 100644 --- a/TsRandomizer/LevelObjects/RoomTriggers.cs +++ b/TsRandomizer/LevelObjects/RoomTriggers.cs @@ -468,15 +468,16 @@ static RoomTrigger() RoomTriggers.Add(new RoomTrigger(8, 13, (level, itemLocation, seedOptions, gameSettings, screenManager) => { if (seedOptions.GassMaw) FillRoomWithGas(level); - if (gameSettings.BossRando.Value - && level.GameSave.GetSaveBool("TSRando_IsBossDead_Maw") + if (!level.GameSave.GetSaveBool("TSRando_IsBossDead_Maw")) + return; + level.GameSave.SetValue("TSRando_IsVileteSaved", true); + if (gameSettings.BossRando.Value && !level.GameSave.GetSaveBool("IsVileteSaved")) { var enumValue = CutsceneEnumType.GetEnumValue("CavesPast6_MawBoom"); - level.GameSave.SetValue("TSRando_IsVileteSaved", true); CreateAndCallCutsceneMethod.InvokeStatic(enumValue, level, new Point(200, 200)); - return; } + BestiaryManager.RefreshBossSaveFlags(level); })); RoomTriggers.Add(new RoomTrigger(8, 21, (level, itemLocation, seedOptions, gameSettings, screenManager) => { if (seedOptions.GassMaw) FillRoomWithGas(level); diff --git a/TsRandomizer/Screens/GameplayScreen.cs b/TsRandomizer/Screens/GameplayScreen.cs index 6f2e797c..7792a9e8 100644 --- a/TsRandomizer/Screens/GameplayScreen.cs +++ b/TsRandomizer/Screens/GameplayScreen.cs @@ -92,6 +92,8 @@ public override void Initialize(ItemLocationMap _, GCM gameContentManager) OrbDamageManager.PopulateOrbLookups(Level.GameSave, settings.DamageRando.Value, settings.DamageRandoOverrides.Value); BestiaryManager.UpdateBestiary(Level, settings); + if (!saveFile.GetSaveBool("IsFightingBoss")) + BestiaryManager.RefreshBossSaveFlags(Level); if (seedOptions.Archipelago) {