Skip to content

Commit

Permalink
Merge pull request Jarno458#86 from TriumphantBass/fix/refresh-boss-save
Browse files Browse the repository at this point in the history
Fix setting the IsVileteSaved flag on non-randomized boss runs
  • Loading branch information
Jarno458 authored Jun 7, 2022
2 parents 056028c + 4992a35 commit edaf267
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TsRandomizer/LevelObjects/RoomTriggers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions TsRandomizer/Screens/GameplayScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit edaf267

Please sign in to comment.