Skip to content

Commit

Permalink
Merge pull request #1088 from wowsims/bugfix/damage-taken-percent
Browse files Browse the repository at this point in the history
Add DTPS Percent metric
  • Loading branch information
1337LutZ authored Oct 8, 2024
2 parents 1547d76 + 3614633 commit 565cafa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/core/components/detailed_results/dtps_metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class DtpsMetricsTable extends MetricsTable<ActionMetrics> {
cellElem.appendChild(
<MetricsTotalBar
spellSchool={metric.spellSchool}
percentage={metric.totalDamagePercent}
percentage={metric.totalDamageTakenPercent}
max={this.maxDtpsAmount}
total={metric.avgDamage}
value={metric.damage}
Expand Down
7 changes: 7 additions & 0 deletions ui/core/proto_utils/sim_result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,13 @@ export class ActionMetrics {
return this.data.isPassive;
}

get totalDamageTakenPercent() {
const totalAvgDtps = this.resultData.result.encounterMetrics?.targets?.[this.unit?.unitIndex || 0].dps?.avg;
if (!totalAvgDtps) return undefined;

return (this.avgDamage / (totalAvgDtps * this.duration)) * 100;
}

get totalDamagePercent() {
const totalAvgDps = this.resultData.result.raidMetrics?.dps?.avg;
if (!totalAvgDps) return undefined;
Expand Down

0 comments on commit 565cafa

Please sign in to comment.