Skip to content

Commit

Permalink
#256 team stat display for new stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ebshimizu committed Dec 27, 2018
1 parent fe1f631 commit c198582
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion hots-parser
Submodule hots-parser updated 1 files
+4 −0 parser.js
4 changes: 3 additions & 1 deletion js/game-data/detail-stat-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ const DetailStatString = {
'passiveXPGain' : 'Passive XP Gained',
'levelAdvTime' : 'Time with Level Advantage',
'maxLevelAdv' : 'Max Level Advantage',
'avgLevelAdv' : 'Avg. Level Advantage'
'avgLevelAdv' : 'Avg. Level Advantage',
'pctWithHeroAdv' : '% of Game with Hero Adv.',
'levelAdvPct' : '% of Game with Level Adv.'
};

module.exports = DetailStatString;
6 changes: 3 additions & 3 deletions js/match-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ function updateTeamStats() {
// mercs
updateTeamStat(elem, 'merc-capture', stats.mercCaptures);
updateTeamStat(elem, 'merc-uptime', formatSeconds(stats.mercUptime));
updateTeamStat(elem, 'merc-uptime-pct', formatStat('mercUptimePercent', stats.mercUptimePercent));
updateTeamStat(elem, 'merc-uptime-pct', formatStat('pct', stats.mercUptimePercent));

updateTeamStat(elem, 'forts-destroyed', stats.structures.Fort.destroyed ? stats.structures.Fort.destroyed : '0');
updateTeamStat(elem, 'forts-lost', stats.structures.Fort.lost);
Expand Down Expand Up @@ -2494,10 +2494,10 @@ function renderV7TeamStats(elem, stats) {
updateTeamStat(elem, 'team-hero-wipes', stats.wipes);
updateTeamStat(elem, 'team-hero-aces', stats.aces);
updateTeamStat(elem, 'team-hero-alive', formatStat('avgHeroesAlive', stats.avgHeroesAlive, true));
updateTeamStat(elem, 'team-hero-time-adv', formatSeconds(stats.timeWithHeroAdv));
updateTeamStat(elem, 'team-hero-time-adv', formatStat('pct', stats.pctWithHeroAdv));
updateTeamStat(elem, 'team-avg-level-adv', formatStat('avgLevelAdv', stats.avgLevelAdv, true));
updateTeamStat(elem, 'team-max-level-adv', stats.maxLevelAdv);
updateTeamStat(elem, 'team-time-level-adv', formatSeconds(stats.levelAdvTime));
updateTeamStat(elem, 'team-time-level-adv', formatStat('pct', stats.levelAdvPct));
updateTeamStat(elem, 'team-passive-xp-rate', formatStat('passiveXPRate', stats.passiveXPRate, true));
updateTeamStat(elem, 'team-passive-xp-diff', formatStat('passiveXPDiff', stats.passiveXPDiff, true));
updateTeamStat(elem, 'team-passive-xp-total', formatStat('passiveXPGain', stats.passiveXPGain, true));
Expand Down
6 changes: 5 additions & 1 deletion js/teams.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ function loadTeamData(team, matches, heroData) {
updateTeamStat(elem, 'team-passive-gain', formatStat('passiveXPDiff', teamStats.stats.average.passiveXPDiff, true));
updateTeamStat(elem, 'team-passive-total', formatStat('passiveXPGain', teamStats.stats.average.passiveXPGain, true));

updateTeamStat(elem, 'team-level-adv-time', formatStat('levelAdvTime', teamStats.stats.average.levelAdvTime, true));
updateTeamStat(elem, 'team-level-adv-time', formatSeconds(teamStats.stats.average.levelAdvTime));
updateTeamStat(elem, 'team-level-adv-pct', formatStat('levelAdvPct', teamStats.stats.average.levelAdvPct, true));
updateTeamStat(elem, 'team-avg-level-adv', formatStat('avgLevelAdv', teamStats.stats.average.avgLevelAdv, true));
updateTeamStat(elem, 'team-avg-level-lead', formatStat('maxLevelAdv', teamStats.stats.average.maxLevelAdv, true));

Expand Down Expand Up @@ -391,6 +392,7 @@ function loadTeamData(team, matches, heroData) {
updateTeamStat(elem, 'team-wipes', formatStat('wipes', teamStats.stats.total.wipes, true));

updateTeamStat(elem, 'team-time-hero-adv', formatSeconds(teamStats.stats.average.timeWithHeroAdv));
updateTeamStat(elem, 'team-time-hero-advp', formatStat('pct', teamStats.stats.average.pctWithHeroAdv, true));
updateTeamStat(elem, 'team-heroes-alive', formatStat('avgHeroesAlive', teamStats.stats.average.avgHeroesAlive, true));

updateTeamStat(elem, 'team-pct-0-hero', formatStat('pctWith0HeroesAlive', teamStats.stats.average.pctWith0HeroesAlive, true));
Expand Down Expand Up @@ -560,6 +562,7 @@ function getTeamCompareStats(teamStats, heroStats) {
stats.passiveTotal = { name: 'Passive XP Gain', val: teamStats.stats.average.passiveXPRate, format: formatStat('passiveXPGain', teamStats.stats.average.passiveXPGain, true) };

stats.levelAdvTime = { name: 'Avg. Time w/ Level Adv.', val: teamStats.stats.average.levelAdvTime, format: formatSeconds(teamStats.stats.average.levelAdvTime) };
stats.levelAdvPct = { name: 'Avg. % of Game w/ Level Adv.', val: teamStats.stats.average.levelAdvPct, format: formatStat('pct', teamStats.stats.average.levelAdvPct, true) };
stats.levelAdv = { name: 'Avg. Level Adv.', val: teamStats.stats.average.avgLevelAdv, format: formatStat('avgLevelAdv', teamStats.stats.average.avgLevelAdv, true) };
stats.levelLead = { name: 'Avg. Max Level Lead', val: teamStats.stats.average.maxLevelAdv, format: formatSeconds('maxLevelAdv', teamStats.stats.average.maxLevelAdv, true) };

Expand Down Expand Up @@ -599,6 +602,7 @@ function getTeamCompareStats(teamStats, heroStats) {
stats.wipes = { name : 'Wipes', val: teamStats.stats.total.wipes, format: formatStat('Wipes', teamStats.stats.total.wipes, true) };

stats.timeWithHeroAdv = { name : 'Avg. Time w/ Hero Adv.', val: teamStats.stats.average.timeWithHeroAdv, format: formatSeconds(teamStats.stats.average.timeWithHeroAdv) };
stats.pctWithHeroAdv = { name: 'Avg. % of Game w/ Hero Adv.', val: teamStats.stats.average.pctWithHeroAdv, format: formatStat('pctWithHeroAdv', teamStats.stats.average.pctWithHeroAdv, true) };
stats.avgHeroesAlive = { name : 'Avg. Heroes Alive', val: teamStats.stats.average.avgHeroesAlive, format: formatStat('avgHeroesAlive', teamStats.stats.average.avgHeroesAlive, true) };

stats.pct0Hero = { name: 'Avg. % 0 Heroes Alive', val: teamStats.stats.average.pctWith0HeroesAlive, format: formatStat('pctWith0HeroesAlive', teamStats.stats.average.pctWith0HeroesAlive, true) };
Expand Down
8 changes: 4 additions & 4 deletions templates/match-detail-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ <h3 class="ui red-team inverted small red header">RED Team</h3>
</div>
<div class="statistic" name="team-hero-time-adv">
<div class="value">###</div>
<div class="label">Time w/ Hero Adv.</div>
<div class="label">Hero Adv. %</div>
</div>
</div>
<div class="ui inverted horizontal divider">Levels</div>
Expand All @@ -320,7 +320,7 @@ <h3 class="ui red-team inverted small red header">RED Team</h3>
</div>
<div class="statistic" name="team-time-level-adv">
<div class="value">###</div>
<div class="label">Level Adv. Time</div>
<div class="label">Level Adv. %</div>
</div>
</div>
<div class="ui inverted horizontal divider">Passive XP</div>
Expand Down Expand Up @@ -452,7 +452,7 @@ <h3 class="ui red-team inverted small red header">RED Team</h3>
</div>
<div class="statistic" name="team-hero-time-adv">
<div class="value">###</div>
<div class="label">Time w/ Hero Adv.</div>
<div class="label">Hero Adv. %</div>
</div>
</div>
<div class="ui inverted horizontal divider">Levels</div>
Expand All @@ -475,7 +475,7 @@ <h3 class="ui red-team inverted small red header">RED Team</h3>
</div>
<div class="statistic" name="team-time-level-adv">
<div class="value">###</div>
<div class="label">Level Adv. Time</div>
<div class="label">Level Adv. %</div>
</div>
</div>
<div class="ui inverted horizontal divider">Passive XP</div>
Expand Down
26 changes: 17 additions & 9 deletions templates/teams-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,19 @@ <h1 class="ui inverted header team-name">[Team Name]</h1>
<div class="label">Damage Taken</div>
</div>
</div>
<div class="ui inverted horizontal divider">Hero Advantages</div>
<div class="ui two inverted tiny statistics">
<div class="ui inverted horizontal divider">Avg. Hero Advantages</div>
<div class="ui three inverted tiny statistics">
<div class="statistic" name="team-time-hero-adv">
<div class="value">###</div>
<div class="label">Avg. Time w/ Hero Adv.</div>
<div class="label">Time w/ Hero Adv.</div>
</div>
<div class="statistic" name="team-time-hero-advp">
<div class="value">###</div>
<div class="label">Hero Adv. %</div>
</div>
<div class="statistic" name="team-heroes-alive">
<div class="value">###</div>
<div class="label">Avg. Heroes Alive</div>
<div class="label">Heroes Alive</div>
</div>
</div>
<div class="ui inverted horizontal divider">Average Hero Uptime %</div>
Expand Down Expand Up @@ -330,19 +334,23 @@ <h1 class="ui inverted header team-name">[Team Name]</h1>
<div class="label">Times Reached 20</div>
</div>
</div>
<div class="ui inverted horizontal divider">Level Advantage</div>
<div class="ui three inverted tiny statistics">
<div class="ui inverted horizontal divider">Avg. Level Advantage</div>
<div class="ui four inverted tiny statistics">
<div class="statistic" name="team-level-adv-time">
<div class="value">###</div>
<div class="label">Avg. Time w/ Level Adv.</div>
<div class="label">Time w/ Level Adv.</div>
</div>
<div class="statistic" name="team-level-adv-pct">
<div class="value">###</div>
<div class="label">Level Adv. %</div>
</div>
<div class="statistic" name="team-avg-level-adv">
<div class="value">###</div>
<div class="label">Avg. Level Advantage</div>
<div class="label">Level Advantage</div>
</div>
<div class="statistic" name="team-avg-level-lead">
<div class="value">###</div>
<div class="label">Avg. Max Level Lead</div>
<div class="label">Max Level Lead</div>
</div>
</div>
<div class="ui inverted horizontal divider">Passive XP</div>
Expand Down

0 comments on commit c198582

Please sign in to comment.