Skip to content

Commit

Permalink
v1.3.3
Browse files Browse the repository at this point in the history
hits won't reset after failing pantheon so you can look at your last run
  • Loading branch information
Dastan21 committed Feb 5, 2022
1 parent 9b0c9d0 commit cef7862
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions PantheonsHitCounter/Pantheon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Pantheon
[JsonProperty("name")] public string name;
[JsonProperty("number")] public int number;
[JsonProperty("bosses")] public List<Boss> bosses;
public List<Boss> nextBosses;
public int bossNumber;

public int TotalHits
Expand Down Expand Up @@ -59,6 +60,12 @@ public void ResetPbCounter()
boss.hitsPb = -1;
}

public void ReplaceBosses()
{
bosses = nextBosses;
nextBosses = null;
}

public Boss GetBossBySceneName(string sceneName) => bosses.Find(boss => boss.sceneName.Equals(sceneName));
public Boss GetBossByName(string bossName) => bosses.Find(boss => boss.name.Equals(bossName));
public void NextBoss()
Expand Down
5 changes: 3 additions & 2 deletions PantheonsHitCounter/PantheonsHitCounter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class PantheonsHitCounter : Mod, IGlobalSettings<GlobalData>, ILocalSetti
public const int CompactSplitsCountMax = 22;

public PantheonsHitCounter() : base("Pantheons Hit Counter") {}
public override string GetVersion() => "1.3.2";
public override string GetVersion() => "1.3.3";
public MenuScreen GetMenuScreen(MenuScreen modListMenu, ModToggleDelegates? toggle) => ModMenu.GetMenu(modListMenu, toggle);
public void OnLoadGlobal(GlobalData data) => globalData = data;
public GlobalData OnSaveGlobal() => globalData;
Expand Down Expand Up @@ -90,7 +90,7 @@ private void OnRandomizedPantheon(On.BossSequenceDoor.orig_Start orig, BossSeque
bosses.Add(newBoss);
}

pantheon.bosses = bosses;
pantheon.nextBosses = bosses;
}

private void LoadPBs(int _)
Expand Down Expand Up @@ -142,6 +142,7 @@ private void OnEnterPantheon(int pantheonNumber)
_inPantheon = true;

currentPantheon.ResetCounter();
currentPantheon.ReplaceBosses();

if (ResourcesLoader.Instance.canvas) ResourcesLoader.Instance.Destroy();
ResourcesLoader.Instance.BuildMenus(currentPantheon);
Expand Down

0 comments on commit cef7862

Please sign in to comment.