From 74d606bef1d0259fa28dee011db41de1fb236b98 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 12 Jul 2018 11:34:43 +0200 Subject: Add Blitz Points statistics --- src/Highlights.vue | 30 ++++++++++++++++++++++++++++++ src/ReportService.js | 29 ++++++++++++++++++++++++++++- src/ReportTable.vue | 4 ++++ src/maps/maps.js | 15 +++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Highlights.vue b/src/Highlights.vue index 0aa8a5f..ff40906 100644 --- a/src/Highlights.vue +++ b/src/Highlights.vue @@ -72,6 +72,33 @@ :entry="stats.topLegendaryWin" /> + {{ stats.topBlitzPoints }} +
+ +
+ +
+ +
+ +
+ +
@@ -96,6 +123,9 @@ export default Vue.component('highlights', { topLegendaryWin: ReportService.getTopLegendaryWins(this.selectedMode), topLowLevel: ReportService.getTopLowLevel(this.selectedMode), topScaling: ReportService.getTopScaling(this.selectedMode), + topKillDeathPoints: ReportService.getTopKillDeathPoints(this.selectedMode), + topObjectivePoints: ReportService.getTopObjectivePoints(this.selectedMode), + topBlitzPointsDelta: ReportService.getTopBlitzPointsDelta(this.selectedMode), }; }, playersPerMatch: function() { diff --git a/src/ReportService.js b/src/ReportService.js index 3da118a..0ac4239 100644 --- a/src/ReportService.js +++ b/src/ReportService.js @@ -5,7 +5,7 @@ const POPULAR_THRESHOLD = 1.0; // percent const PICKS_THRESHOLD = 300; // picks const VARIANCE_THRESHOLD = 0.25; // % minimum accuracy -const report = require('../data/2d73896c/report.json') +const report = require('../data/5f7773da/report.json') .filter((entry) => entry.Actor != undefined); // bad data from API downtime const reports = new Map(); @@ -19,6 +19,9 @@ const topLegendaryWins = new Map(); const topLowLevel = new Map(); const topScaling = new Map(); const topUnpopularWins = new Map(); +const topKillDeathPoints = new Map(); +const topObjectivePoints = new Map(); +const topBlitzPointsDelta = new Map(); let totalMatches = 0; let actors = []; const modes = metadata.config.api.modes; @@ -80,6 +83,9 @@ for(let mode of modes) { TotalPicks: sum_weights || entry.Count, // NoTalent has no weights TotalWinner: sum_y / sum_weights || entry.Winner, SampleTooSmall: sum_weights < PICKS_THRESHOLD, + KillDeathPoints: maps.killDeathPoints(entry), + ObjectivePoints: maps.objectivePoints(entry), + BlitzPointsDelta: maps.blitzPointsDelta(entry), VarianceTooLarge: rsquare < VARIANCE_THRESHOLD, }); }); @@ -115,6 +121,15 @@ for(let mode of modes) { topScaling.set(mode, reports.get(mode) .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) .sort((entry1, entry2) => entry2.TalentWinrateLevelScaling - entry1.TalentWinrateLevelScaling)[0]); + topKillDeathPoints.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.KillDeathPoints - entry1.KillDeathPoints)[0]); + topObjectivePoints.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.ObjectivePoints - entry1.ObjectivePoints)[0]); + topBlitzPointsDelta.set(mode, reports.get(mode) + .filter((entry) => !entry.SampleTooSmall && !entry.VarianceTooLarge) + .sort((entry1, entry2) => entry2.BlitzPointsDelta - entry1.BlitzPointsDelta)[0]); if (actors.length == 0) { actors = [...new Set(reports.get(mode).map((entry) => entry.Actor))]; @@ -170,6 +185,18 @@ export default { return topUnpopular.get(mode); }, + getTopKillDeathPoints(mode) { + return topKillDeathPoints.get(mode); + }, + + getTopObjectivePoints(mode) { + return topObjectivePoints.get(mode); + }, + + getTopBlitzPointsDelta(mode) { + return topBlitzPointsDelta.get(mode); + }, + getActors() { return actors; }, diff --git a/src/ReportTable.vue b/src/ReportTable.vue index 789b7f2..2297b14 100644 --- a/src/ReportTable.vue +++ b/src/ReportTable.vue @@ -81,6 +81,10 @@ + + {{ props.row.BlitzPointsDelta.toFixed(2) }} + + {{ (100 * props.row.Winner).toFixed(0) }}% diff --git a/src/maps/maps.js b/src/maps/maps.js index ce91c24..7b48ce0 100644 --- a/src/maps/maps.js +++ b/src/maps/maps.js @@ -78,6 +78,18 @@ function playersPerMatch(mode) { return mode.includes('5v5')? 10 : 6; } +function killDeathPoints(entry) { + return entry.Kills - entry.Deaths; +} + +function objectivePoints(entry) { + return entry.CrystalMinerKills + entry.GoldMinerKills + entry.TurretKills; +} + +function blitzPointsDelta(entry) { + return killDeathPoints(entry) + objectivePoints(entry) * 3; +} + module.exports = { RARITIES, getTalentName, @@ -88,4 +100,7 @@ module.exports = { getMode, hasTalents, playersPerMatch, + killDeathPoints, + objectivePoints, + blitzPointsDelta, }; -- cgit v1.3.1