Skip to content

Commit

Permalink
Add phys% and ele% columns
Browse files Browse the repository at this point in the history
  • Loading branch information
coavins committed Jul 22, 2022
1 parent b323cfc commit 36b671f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 17 deletions.
8 changes: 6 additions & 2 deletions src/autorun/mhrise-coavins-dps/draw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ this.drawReportItemColumn = function(item, col, x, y)
elseif col == 13 then -- Blast
text = string.format('%.0f', item.totalBlast)
elseif col == 14 then -- Crit%
text = string.format('%.0f%%', item.pctUpCrit * 100.0)
text = string.format('%.1f%%', item.pctUpCrit * 100.0)
elseif col == 15 then -- Weak%
text = string.format('%.0f%%', item.pctDnCrit * 100.0)
text = string.format('%.1f%%', item.pctDnCrit * 100.0)
elseif col == 16 then -- pDPS
text = string.format('%.1f', item.dps.personal)
elseif col == 17 then -- physical damage
Expand All @@ -199,6 +199,10 @@ this.drawReportItemColumn = function(item, col, x, y)
text = string.format('%.0f', item.totalStun)
elseif col == 22 then -- lasthit
text = string.format('%.0f', item.lastHit)
elseif col == 23 then -- phys%
text = string.format('%.1f%%', item.pctPhysical * 100.0)
elseif col == 24 then -- ele%
text = string.format('%.1f%%', item.pctElemental * 100.0)
end

this.drawRichText(text, x, y, CORE.COLOR('WHITE'), CORE.COLOR('BLACK'))
Expand Down
28 changes: 15 additions & 13 deletions src/autorun/mhrise-coavins-dps/enum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ this.TABLE_COLUMNS_OPTIONS_ID[6] = 4
this.TABLE_COLUMNS_OPTIONS_ID[7] = 16
this.TABLE_COLUMNS_OPTIONS_ID[8] = 5
this.TABLE_COLUMNS_OPTIONS_ID[9] = 17
this.TABLE_COLUMNS_OPTIONS_ID[10] = 18
this.TABLE_COLUMNS_OPTIONS_ID[11] = 12
this.TABLE_COLUMNS_OPTIONS_ID[12] = 13
this.TABLE_COLUMNS_OPTIONS_ID[13] = 11
this.TABLE_COLUMNS_OPTIONS_ID[14] = 6
this.TABLE_COLUMNS_OPTIONS_ID[15] = 7
this.TABLE_COLUMNS_OPTIONS_ID[16] = 14
this.TABLE_COLUMNS_OPTIONS_ID[17] = 15
this.TABLE_COLUMNS_OPTIONS_ID[18] = 8
this.TABLE_COLUMNS_OPTIONS_ID[19] = 9
this.TABLE_COLUMNS_OPTIONS_ID[20] = 19
this.TABLE_COLUMNS_OPTIONS_ID[21] = 21
this.TABLE_COLUMNS_OPTIONS_ID[22] = 22
this.TABLE_COLUMNS_OPTIONS_ID[10] = 23
this.TABLE_COLUMNS_OPTIONS_ID[11] = 18
this.TABLE_COLUMNS_OPTIONS_ID[12] = 24
this.TABLE_COLUMNS_OPTIONS_ID[13] = 12
this.TABLE_COLUMNS_OPTIONS_ID[14] = 13
this.TABLE_COLUMNS_OPTIONS_ID[15] = 11
this.TABLE_COLUMNS_OPTIONS_ID[16] = 6
this.TABLE_COLUMNS_OPTIONS_ID[17] = 7
this.TABLE_COLUMNS_OPTIONS_ID[18] = 14
this.TABLE_COLUMNS_OPTIONS_ID[19] = 15
this.TABLE_COLUMNS_OPTIONS_ID[20] = 8
this.TABLE_COLUMNS_OPTIONS_ID[21] = 9
this.TABLE_COLUMNS_OPTIONS_ID[22] = 19
this.TABLE_COLUMNS_OPTIONS_ID[23] = 21
this.TABLE_COLUMNS_OPTIONS_ID[24] = 22
-- populated when locale is loaded
this.TABLE_COLUMNS_OPTIONS_READABLE = {}
for i,_ in ipairs(this.TABLE_COLUMNS_OPTIONS_ID) do
Expand Down
5 changes: 5 additions & 0 deletions src/autorun/mhrise-coavins-dps/report.lua
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,11 @@ this.mergeBossIntoReport = function(report, boss)
item.total = sum.total
end

if item.total > 0 then
item.pctPhysical = item.totalPhysical / item.total
item.pctElemental = item.totalElemental / item.total
end

-- calculate dps
if report.time > 0 then
item.dps.report = item.total / report.time
Expand Down
4 changes: 3 additions & 1 deletion src/data/mhrise-coavins-dps/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@
30.0,
30.0,
30.0,
30.0
30.0,
53.0,
53.0
],
"TABLE_GROWS_UPWARD": {
"VALUE": false
Expand Down
4 changes: 3 additions & 1 deletion src/data/mhrise-coavins-dps/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
"19": "Carts",
"20": "MR",
"21": "Stun",
"22": "Last"
"22": "Last",
"23": "Phys%",
"24": "Ele%"
},
"damage_types": {
"BallistaHate": "BallistaHate",
Expand Down

0 comments on commit 36b671f

Please sign in to comment.