Skip to content

Commit

Permalink
#256 added columns to collection: teams
Browse files Browse the repository at this point in the history
  • Loading branch information
ebshimizu committed Dec 27, 2018
1 parent 431818e commit c9b2f6d
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/util/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function formatStat(field, val, allFixed = false) {
if (val === undefined)
return 0;

if (field.startsWith('pct') || field === 'KillParticipation' || field === 'timeDeadPct') {
if (field.startsWith('pct') || field === 'mercUptimePercent' || field === 'KillParticipation' || field === 'timeDeadPct') {
if (val > 1) {
return `${val.toLocaleString(undefined, {maximumFractionDigits: 1})}%`;
}
Expand Down
90 changes: 90 additions & 0 deletions js/util/table-defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,61 @@ const TeamRankingFormat = {
data: 'selectedStats.timeDeadPct',
render: (data) => formatStat('timeDeadPct', data)
},
{
title: 'Time w/ Level Adv.',
data: 'selectedStats.levelAdvTime',
render: formatSeconds
},
{
title: '% of Game w/ Level Adv.',
data: 'selectedStats.levelAdvPct',
render: (data) => formatStat('pct', data, true)
},
{
title: 'Avg. Level Adv.',
data: 'selectedStats.avgLevelAdv',
render: (data) => formatStat('avgLevelAdv', data, true)
},
{
title: 'Avg. Heroes Alive',
data: 'selectedStats.avgHeroesAlive',
render: (data) => formatStat('avgHeroesAlive', data, true)
},
{
title: 'Time w/ Hero Adv.',
data: 'selectedStats.timeWithHeroAdv',
render: formatSeconds
},
{
title: '% of Game w/ Hero Adv.',
data: 'selectedStats.pctWithHeroAdv',
render: (data) => formatStat('pct', data, true)
},
{
title: 'Aces',
data: 'selectedStats.aces',
render: (data) => formatStat('aces', data, true)
},
{
title: 'Wipes',
data: 'selectedStats.wipes',
render: (data) => formatStat('wipes', data, true)
},
{
title: 'Passive XP/s',
data: 'selectedStats.passiveXPRate',
render: (data) => formatStat('passiveXPRate', data, true)
},
{
title: 'Passive XP % Gain',
data: 'selectedStats.passiveXPDiff',
render: (data) => formatStat('passiveXPDiff', data, true)
},
{
title: 'Passive XP Gain',
data: 'selectedStats.passiveXPGain',
render: (data) => formatStat('passiveXPGain', data, true)
},
{
title: 'Hero Damage',
data: 'selectedStats.HeroDamage',
Expand Down Expand Up @@ -899,6 +954,36 @@ const TeamRankingFormat = {
data: 'tierTimes.T6.average',
render: formatSeconds
},
{
title: '% of Game w/ 0 Heroes',
data: 'selectedStats.pctWith0HeroesAlive',
render: (data) => formatStat('pctWith0HeroesAlive', data)
},
{
title: '% of Game w/ 1 Heroes',
data: 'selectedStats.pctWith1HeroesAlive',
render: (data) => formatStat('pctWith1HeroesAlive', data)
},
{
title: '% of Game w/ 2 Heroes',
data: 'selectedStats.pctWith2HeroesAlive',
render: (data) => formatStat('pctWith2HeroesAlive', data)
},
{
title: '% of Game w/ 3 Heroes',
data: 'selectedStats.pctWith3HeroesAlive',
render: (data) => formatStat('pctWith3HeroesAlive', data)
},
{
title: '% of Game w/ 4 Heroes',
data: 'selectedStats.pctWith4HeroesAlive',
render: (data) => formatStat('pctWith4HeroesAlive', data)
},
{
title: '% of Game w/ 5 Heroes',
data: 'selectedStats.pctWith5HeroesAlive',
render: (data) => formatStat('pctWith5HeroesAlive', data)
},
{
title: 'Mercenary Captures',
data: 'selectedStats.mercCaptures',
Expand Down Expand Up @@ -929,6 +1014,11 @@ const TeamRankingFormat = {
data: 'endOfGameLevels.loss.average',
render: (data) => formatStat('', data, true)
},
{
title: 'Max Level Adv.',
data: 'selectedStats.maxLevelAdv',
render: (data) => formatStat('maxLevelAdv', data)
},
{
title: 'Forts Destroyed',
data: 'structures.Fort.destroyed',
Expand Down

0 comments on commit c9b2f6d

Please sign in to comment.