public ActionResult Index() { var viewModel = new List <ProgressionData>(); // Randomize data var rnd = new Random(); for (int i = 0; i < 100; i++) { var model = new ProgressionData() { Total = rnd.Next(1000, 10000), Progress = new List <int>() }; for (int j = 0; j < 5; j++) { model.Progress.Add(rnd.Next(0, model.Total + 1)); } viewModel.Add(model); } return(View(viewModel)); }
public static bool Prefix([NotNull] LevelUpState state, [NotNull] UnitDescriptor unit, [NotNull] BlueprintProgression progression) { if (!settings.toggleMulticlass) { return(false); } ProgressionData progressionData = unit.Progression.SureProgressionData(progression); int level = progressionData.Level; int nextLevel = progressionData.Blueprint.CalcLevel(unit); // TODO - this is from the mod but we need to figure out if max level 20 still makes sense with mythic levels // int maxLevel = 20 // unit.Progression.CharacterLevel; // if (nextLevel > maxLevel) // nextLevel = maxLevel; progressionData.Level = nextLevel; if (level >= nextLevel || (UnityEngine.Object)progression.ExclusiveProgression != (UnityEngine.Object)null && (UnityEngine.Object)state.SelectedClass != (UnityEngine.Object)progression.ExclusiveProgression) { return(false); } if (!progression.GiveFeaturesForPreviousLevels) { level = nextLevel - 1; } for (int i = level + 1; i <= nextLevel; ++i) { if (!AllowProceed(progression)) { break; } LevelEntry levelEntry = progressionData.GetLevelEntry(i); LevelUpHelper.AddFeaturesFromProgression(state, unit, levelEntry.Features, (FeatureSource)progression, i); } return(false); }
static void Prefix(LevelUpState state, UnitDescriptor unit, BlueprintProgression progression) { if (IsAvailable()) { ProgressionData progressionData = unit.Progression.SureProgressionData(progression); int nextLevel = progressionData.Blueprint.CalcLevel(unit); Core.Debug($" - {nameof(LevelUpHelper)}.{nameof(LevelUpHelper.UpdateProgression)}({state.SelectedClass}[{state.NextClassLevel}], {unit}, {progression}) - NextLevel: {nextLevel}"); } }
void Start() { animator = GetComponent <Animator>(); ProgressionData data = SaveSystem.LoadProgression(); LevelInfos.levelProgression = data.levelsCleared; worldNumber = 0; UpdateLevelProgressionUI(); }
public static void SaveProgression(List <string> personnagesNames, int niveauAtteint) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/gamesInfo.fun"; FileStream stream = new FileStream(path, FileMode.Create); ProgressionData data = new ProgressionData(personnagesNames, niveauAtteint); formatter.Serialize(stream, data); stream.Close(); }
private void Start() { ProgressionData data = PlayerInfo.GetPlayer().GetComponent <ProgressionData>(); foreach (Stage stage in stages) { stage.SetActiveState(stage.number <= data.ReachedStage); stage.onSelect += ChangeSelection; } }
public static void SaveProgression() { BinaryFormatter formatter = new BinaryFormatter(); string path = Path.Combine(Application.persistentDataPath, "progression.ff"); FileStream stream = new FileStream(path, FileMode.Create); ProgressionData progressionData = new ProgressionData(); formatter.Serialize(stream, progressionData); stream.Close(); }
private void OverallProgressBarPaint(object sender, PaintEventArgs e) { if (ProgressionData != null) { BufferedGraphicsContext Current = BufferedGraphicsManager.Current; BufferedGraphics Offscreen = Current.Allocate(e.Graphics, OverallProgressBar.ClientRectangle); ProgressionData.DrawOverallProgressBar(Offscreen.Graphics, OverallProgressBar.ClientRectangle); // Copy the offscreen buffer to the screen Offscreen.Render(); Offscreen.Dispose(); } }
public void LoadProgress() { ProgressionData data = SaveSystem.LoadProgression(); if (data != null) //If there's something to load { for (int i = 0; i < data.levelsCleared.Length; i++) { LevelInfos.levelProgression[i] = data.levelsCleared[i]; } } else { LevelInfos.levelProgression = new bool[10]; } }
public static ProgressionData LoadProgression() { string path = Path.Combine(Application.persistentDataPath, "progression.ff"); if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); ProgressionData data = (ProgressionData)formatter.Deserialize(stream); stream.Close(); return(data); } else { return(null); } }
public static ProgressionData LoadProgression() { string path = Application.persistentDataPath + "/gamesInfo.fun"; Debug.Log("load ici : " + path); if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); ProgressionData data = formatter.Deserialize(stream) as ProgressionData; stream.Close(); return(data); } else { return(null); } }
public void loadSave() { ProgressionData data = SaveSystem.LoadProgression(); List <GameObject> joueurChoisi = new List <GameObject>(); if (data != null) { foreach (string nom in data.personnages) { joueurChoisi.Add(findJoueur(nom)); } } else { joueurChoisi.Add(findJoueur("j1")); } initGame(joueurChoisi); }
public static void SaveProgression(string zoneName) { if (savePath != "" && savePath != null) { BinaryFormatter formatter = new BinaryFormatter(); //string path = savePath + zoneDataFileNamePrefixe + zoneName + zoneSaveFileExtension; string path = Path.Combine(savePath, zoneDataFileNamePrefixe + zoneName + zoneSaveFileExtension); FileStream stream = new FileStream(path, FileMode.Create); ZoneData zoneData = new ZoneData(); formatter.Serialize(stream, zoneData); stream.Close(); //Debug.Log("Player saved in " + path); } else { Debug.LogError("The savePath has not been set"); } if (savePath != "" && savePath != null) { BinaryFormatter formatter = new BinaryFormatter(); //string path = savePath + progressionDataSaveFileName + progressionSaveFileExtension; string path = Path.Combine(savePath, progressionDataSaveFileName + progressionSaveFileExtension); FileStream stream = new FileStream(path, FileMode.Create); ProgressionData progressionData = new ProgressionData(GameManager.currentStoryStep); formatter.Serialize(stream, progressionData); stream.Close(); //Debug.Log("Player saved in " + path); } else { Debug.LogError("The savePath has not been set"); } }
public static bool Prefix(ref ProgressionData __instance) { if (!ModSettings.enableSuperPet) { return(true); } if (__instance.Archetypes.Count <= 0) { __instance.LevelEntries = __instance.Blueprint.LevelEntries; return(false); } List <LevelEntry> list = new List <LevelEntry>(); for (int i = 1; i <= RankToLevel[RankToLevel.Length - 1]; i++) { List <BlueprintFeatureBase> list2 = new List <BlueprintFeatureBase>(__instance.Blueprint.GetLevelEntry(i).Features); foreach (BlueprintArchetype blueprintArchetype in __instance.Archetypes) { foreach (BlueprintFeatureBase item in blueprintArchetype.GetRemoveEntry(i).Features) { list2.Remove(item); } list2.AddRange(blueprintArchetype.GetAddEntry(i).Features); } if (list2.Count > 0) { list.Add(new LevelEntry { Features = list2, Level = i }); } } __instance.LevelEntries = list.ToArray(); return(false); }
public static ProgressionData LoadProgression() { //string path = savePath + progressionDataSaveFileName + progressionSaveFileExtension; string path = Path.Combine(savePath, progressionDataSaveFileName + progressionSaveFileExtension); if (File.Exists(path)) { BinaryFormatter formatter = new BinaryFormatter(); FileStream stream = new FileStream(path, FileMode.Open); ProgressionData progressionData = formatter.Deserialize(stream) as ProgressionData; stream.Close(); //Debug.Log("PLayer loaded from " + path); return(progressionData); } else { Debug.LogWarning("Save file not found in " + path); return(null); } }
public static void LoadProgression() { ZoneData zoneData = SaveSystem.LoadZone(currentZoneName); if (zoneData != null) { for (int i = 0; i < LevelManager.allZoneSwitchs.Count; i++) { LevelManager.allZoneSwitchs[i].isOn = zoneData.switchStates[i]; } for (int i = 0; i < LevelManager.allZoneEnemies.Count; i++) { if (!zoneData.enemyStates[i]) { Destroy(LevelManager.allZoneEnemies[i].gameObject); } } for (int i = 0; i < LevelManager.allZoneCheckPoints.Count; i++) { if (LevelManager.allZoneCheckPoints[i].checkPointNumber == zoneData.lastCheckPointIndex) { GameData.player.transform.position = LevelManager.allZoneCheckPoints[i].transform.position; GameData.mainCamera.transform.position = LevelManager.allZoneCheckPoints[i].transform.position; } } } ProgressionData progressionData = SaveSystem.LoadProgression(); if (progressionData != null) { currentStoryStep = progressionData.currentStoryStep; } }