private static void CmdHearts(int amount = int.MaxValue, string levelSet = null) { patch_SaveData saveData = SaveData.Instance as patch_SaveData; if (saveData == null) { return; } amount = Calc.Clamp(amount, 0, saveData.LevelSetStats.MaxHeartGems); if (string.IsNullOrEmpty(levelSet)) { levelSet = saveData.GetLevelSet(); } int num = 0; foreach (patch_AreaStats areaStats in saveData.Areas_Safe.Cast <patch_AreaStats>().Where(stats => stats.LevelSet == levelSet)) { foreach (AreaModeStats areaModeStats in areaStats.Modes) { if (num < amount) { areaModeStats.HeartGem = true; num++; } else { areaModeStats.HeartGem = false; } } } }
public new void UnlockEverything(Level level) { patch_SaveData data = (patch_SaveData)SaveData.Instance; if (data.LevelSet == "Celeste") { foreach (LevelSetStats set in data.LevelSets) { set.UnlockedAreas = set.MaxArea; } SaveData.Instance.RevealedChapter9 = true; Settings.Instance.VariantsUnlocked = true; Settings.Instance.Pico8OnMainMenu = true; UnlockDemoConfig(); } else { data.LevelSetStats.UnlockedAreas = data.LevelSetStats.MaxArea; } data.CheatMode = true; level.Session.InArea = false; Engine.Scene = new LevelExit(LevelExit.Mode.GiveUp, level.Session); }
public new void UnlockEverything(Level level) { patch_SaveData data = (patch_SaveData)SaveData.Instance; foreach (LevelSetStats set in data.LevelSets) { set.UnlockedAreas = SaveData.Instance.MaxArea; } data.CheatMode = true; Settings.Instance.Pico8OnMainMenu = true; Settings.Instance.VariantsUnlocked = true; level.Session.InArea = false; Engine.Scene = new LevelExit(LevelExit.Mode.GiveUp, level.Session); }
private static void CmdHearts(int amount = int.MaxValue, string levelSet = null) { patch_SaveData saveData = SaveData.Instance as patch_SaveData; if (saveData == null) { return; } if (string.IsNullOrEmpty(levelSet)) { levelSet = saveData.GetLevelSet(); } int num = 0; foreach (patch_AreaStats areaStats in saveData.Areas_Safe.Cast <patch_AreaStats>().Where(stats => stats.LevelSet == levelSet)) { for (int i = 0; i < areaStats.Modes.Length; i++) { if (AreaData.Get(areaStats.ID).Mode is not { } mode || mode.Length <= i || mode[i]?.MapData == null) { continue; } AreaModeStats areaModeStats = areaStats.Modes[i]; if (num < amount) { areaModeStats.HeartGem = true; num++; } else { areaModeStats.HeartGem = false; } } } }