private void SetStats(int level) { Level = level; Health = new ResourceBar(StatsGenerator.GetHeroHealth(level)); Stamina = new ResourceBar(StatsGenerator.GetHeroStamina(level)); Weapon = new Weapon(level); }
private async void Run() { string error = ""; try { //If the user has selected a fixed reference time, we use tha //otherwise just pass null, which uses the QDMS instruments TimeSpan?referenceTime = (UseSessionsTime || !ReferenceTime.HasValue) ? null : (TimeSpan?)ReferenceTime.Value.TimeOfDay; StatsGenerator.GenerateExecutionStats(Benchmark, referenceTime); SetStats(); } catch (Exception ex) { error = ex.Message; } if (!string.IsNullOrEmpty(error)) { await DialogService.ShowMessageAsync(this, "Error", error); } }
public void GainXP(BattleResultEventData data) { //Checking outcome and the data for xp, and debug logging it Debug.Log(data.outcome); Debug.Log(data.Xp); Debug.Log(data.player.xp); Debug.Log(data.npc.xp); if (data.outcome == 1) { data.player.xp += data.Xp; Debug.Log("Player has gained " + data.player.xp + "Xp"); //if outcome = 1 add xp to the player and debug how much you gained } if (data.player.xp >= 100 + (data.player.level * 50)) { data.player.level += 1; //add 1 to the player level GameEvents.PlayerLevelUp(data.player.level); //broadcast level up message Debug.Log("Player has level is " + data.player.level); //debug which level the player is int numPoints = 5; StatsGenerator.AssignUnusedPoints(data.player, 5); // assign 5 points each time data.player.xp = 0; //set xp back to 0 } }
public void GainXP(BattleResultEventData data) { Debug.Log(data.outcome); Debug.Log(data.player.level); Debug.Log(data.player.xp); //checking if player won and then assigning xp if (data.outcome == 1) { data.player.xp += 10; } else { data.player.xp += 2; } if (data.player.xp >= xpRequired) { data.player.level++; Debug.Log("Level is now: " + data.player.level); int pointsToAdd = 10; StatsGenerator.AssignUnusedPoints(data.player, pointsToAdd); GameEvents.PlayerLevelUp(data.player.level); xpRequired += (xpRequired * (data.player.level / 2)); Debug.Log(xpRequired); } // if data.outcome is 1 then player won, otherwise player lost }
public async void OnAppearing() { try { var current = Connectivity.NetworkAccess; if (current == NetworkAccess.Internet) { // Connection to internet is available var stats = await StatsGenerator.GetStatsAsync(); Countrydata = stats; await _pageDialogService.DisplayAlertAsync("Welcome!", "Information on covid-19 in South Africa", "ok"); } } catch (Exception) { var current = Connectivity.NetworkAccess; if (current != NetworkAccess.Internet) { await _pageDialogService.DisplayAlertAsync("Unexpected Error", "No Interent access", "cancel", "ok"); } } }
static async Task Main(string[] args) { Console.WriteLine("Hello World!"); StatsModel weatherBoy = new StatsModel(); Stats weatherInfo = await StatsGenerator.GetWeatherAsync(); Console.Write("Active cases: " + weatherInfo.active); }
// populate graphs, when "Graphs" tab is selected private void OnGraphTabSelected(object sender, RoutedEventArgs e) { stats = StatsGenerator.CountDeviceTypes(dgMain.Items.OfType <Device>().ToList()); lblNumberOfDesktops.Content = stats.NumberOfDesktops; lblNumberOfLaptops.Content = stats.NumberOfNotebooks; pieChart_DevicesTypes.Series[0].Values[0] = (double)stats.NumberOfDesktops; pieChart_DevicesTypes.Series[1].Values[0] = (double)stats.NumberOfNotebooks; PointLabel = chartPoint => string.Format("{0} ({1:P})", chartPoint.Y, chartPoint.Participation); }
private static void Pf_CompletedSuccessfully() { Console.WriteLine("Update completed Sucessfully."); // Set update delay and restart timer. Console.WriteLine("Updating at " + DateTime.Now.AddMilliseconds(updateIntervalAfterCompletion) + "."); pf.PagingDelay = 0; timer.Interval = updateIntervalAfterCompletion; timer.Start(); //If ladder empty do nothing if (pf.Lf.ladder.entries.Count() == 0) { return; } // Save data to file. PoeFilesControl.SaveToFile(pf.Lf); // Get different data objects for statistics/reporting. LeagueInfo data = pf.Lf; List <AccountInfo> accInfo = StatsGenerator.GetAccountsInfo(data); List <string> namesList = StatsGenerator.ListOfAccMultipleCharsAlive(accInfo); // Report owners of multiple alive characters. PTLiveReporter.ReportMultipleAliveChars(namesList); Console.WriteLine("Accounts with multiple alive characters reported to web service."); // Get classes info. List <ClassInfo> x = StatsGenerator.GetClassesInfo(data); // Sort by popularity. List <ClassInfo> orderedByPopularity = x.OrderByDescending(d => d.totalChars).ToList <ClassInfo>(); // Update ascendacy classes info PTLiveReporter.UpdateAscendancyClasses(orderedByPopularity); Console.WriteLine("Ascendancy classes info sent to server."); // Get league statistics. LeagueStats LS = StatsGenerator.GenerateLeagueStats(pf.Lf, (3600000 / updateIntervalAfterCompletion) + 2); // Send league statistics PTLiveReporter.UpdateLeagueStats(LS); Console.WriteLine("General league stats sent to server."); // Update rips counter PTLiveReporter.UpdateRipsCounter(LS.DeadCharacters); Console.WriteLine("Rips Counter updated."); // Increase Updates Counter UpdatesCount++; }
// public static void Main(string[] args) public static void main(string[] args) { // Directory where the source programs and COPY files are stored string sourcePath = @"D:\Users\Laurent\OneDrive\Dev\Visual Studio 2012\Projects\TypeCobol\TypeCobol.Test\Samples\EI Cobol samples\EI-Production"; string[] programExtensions = { ".PGM" }; string[] copyExtensions = { ".CPY" }; // List of all sample programs used to compute the statistics IList <string> textNames = new List <string>(); foreach (string programExtension in programExtensions) { foreach (string filePath in Directory.EnumerateFiles(sourcePath, "*" + programExtension)) { string textName = Path.GetFileNameWithoutExtension(filePath); textNames.Add(textName); } } // Source file format for the samples DocumentFormat docFormat = new DocumentFormat(Encoding.GetEncoding("iso8859-1"), EndOfLineDelimiter.CrLfCharacters, 80, ColumnsLayout.CobolReferenceFormat); // Initialize a compilation project TypeCobolOptions compilerOptions = new TypeCobolOptions(); CompilationProject project = new CompilationProject("samples", sourcePath, programExtensions.Concat(copyExtensions).ToArray(), docFormat.Encoding, docFormat.EndOfLineDelimiter, docFormat.FixedLineLength, docFormat.ColumnsLayout, compilerOptions); // Output files used to store the results string resultFilePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); string countersFile = Path.Combine(resultFilePath, "SyntaxCounters.txt"); string languageModelForProgramFile = Path.Combine(resultFilePath, "LanguageModel.Program.txt"); string languageModelForCopyFile = Path.Combine(resultFilePath, "LanguageModel.Copy.txt"); // Compute statistics Stopwatch chrono = new Stopwatch(); chrono.Start(); StatsGenerator.GenerateStatisticsForPrograms(project, textNames, Console.Out, countersFile, languageModelForProgramFile, languageModelForCopyFile); chrono.Stop(); Console.WriteLine(""); Console.WriteLine("Programs analyzed in " + Math.Round(chrono.ElapsedMilliseconds / (double)1000, 3) + " sec"); }
public Weapon(int level) : base(ItemRarity.Epic) { Speed = StatsGenerator.GetWeaponSpeed(level); Damage = StatsGenerator.GetWeaponDamage(level); }
private void Awake() { //assign initial stats StatsGenerator.InitialStats(this); }
public void GainXP(BattleResultEventData data) { //sets xp to zero (does not effect previous file) data.player.xp = 0; //tries to read the xp from text file try { data.player.xp = System.Convert.ToInt32(System.IO.File.ReadAllText("xp.txt")); } catch { } //adds xp based on win if (data.outcome == 1) { data.player.xp += 20; Debug.Log("win"); Debug.Log(data.player.xp); } if (data.outcome == 0) { data.player.xp += 10; Debug.Log("lose"); Debug.Log(data.player.xp); } //checks level based on total xp if (data.player.xp >= 100 && data.player.level < 2) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 200 && data.player.level < 3) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 300 && data.player.level < 4) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 500 && data.player.level < 5) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 800 && data.player.level < 6) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 1300 && data.player.level < 7) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 2100 && data.player.level < 8) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 3400 && data.player.level < 9) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } if (data.player.xp >= 5500 && data.player.level < 10) { data.player.level += 1; GameEvents.PlayerLevelUp(data.player.level); StatsGenerator.AssignUnusedPoints(data.player, 10); Debug.Log("Level Up"); } System.IO.File.WriteAllText("xp.txt", System.Convert.ToString(data.player.xp)); System.IO.File.WriteAllText("level.txt", System.Convert.ToString(data.player.level)); }
void LevelUp(int level) { Debug.Log("NPC Level Up!"); myStats.level = level; StatsGenerator.AssignUnusedPoints(myStats, 5); }
public static List <Monster> GenerateMonsters() { List <Monster> GeneratedListOfMonsters = new List <Monster>(); Random randomNum = new Random(); for (int dayOfWeek = 0; dayOfWeek < 7; dayOfWeek++) { var Date = (DayOfWeek)dayOfWeek; for (int i = 0; i < Settings.EnemiesCreatedPerDay; i++) { if (i >= 0 && i <= 3) { // 4 Easy enemies created GeneratedListOfMonsters.Add(new Monster(BossNameGen(randomNum), StatsGenerator.Easy(), Date)); } else if (i >= 4 && i <= 7) { // 4 Medium enemies created GeneratedListOfMonsters.Add(new Monster(BossNameGen(randomNum), StatsGenerator.Medium(), Date)); } else if (i >= 8 && i <= 9) { // 2 Hard enemies created GeneratedListOfMonsters.Add(new Monster(BossNameGen(randomNum), StatsGenerator.Hard(), Date)); } } } return(GeneratedListOfMonsters); }