Add masteries to power report#9604
Add masteries to power report#9604ksnyder9801 wants to merge 1 commit intoPathOfBuildingCommunity:devfrom
Conversation
| for nodeId, node in pairs(self.build.spec.nodes) do | ||
| wipeTable(node.power) | ||
| if node.type == "Mastery" then | ||
| node.power.masteryEffects = { } |
There was a problem hiding this comment.
NB: adding a new table to node.power since a single power per node can't represent unallocated mastery options
| end | ||
| end | ||
| end | ||
|
|
There was a problem hiding this comment.
opted to duplicate the power calc in the loop here instead of a bigger refactor for readability
There was a problem hiding this comment.
I'd prefer to not duplicate this logic, actually.
Wires77
left a comment
There was a problem hiding this comment.
There is some opportunity to combine things here, but I like the idea, and love the added test
| local nodePower = (effectPower.singleStat or 0) * ((displayStat.pc or displayStat.mod) and 100 or 1) | ||
| local pathPower = ((effectPower.pathPower or effectPower.singleStat or 0) / pathDist) * ((displayStat.pc or displayStat.mod) and 100 or 1) | ||
| local nodePowerStr = s_format("%"..displayStat.fmt, nodePower) | ||
| local pathPowerStr = s_format("%"..displayStat.fmt, pathPower) | ||
|
|
||
| nodePowerStr = formatNumSep(nodePowerStr) | ||
| pathPowerStr = formatNumSep(pathPowerStr) | ||
|
|
||
| if (nodePower > 0 and not displayStat.lowerIsBetter) or (nodePower < 0 and displayStat.lowerIsBetter) then | ||
| nodePowerStr = colorCodes.POSITIVE .. nodePowerStr | ||
| elseif (nodePower < 0 and not displayStat.lowerIsBetter) or (nodePower > 0 and displayStat.lowerIsBetter) then | ||
| nodePowerStr = colorCodes.NEGATIVE .. nodePowerStr | ||
| end | ||
| if (pathPower > 0 and not displayStat.lowerIsBetter) or (pathPower < 0 and displayStat.lowerIsBetter) then | ||
| pathPowerStr = colorCodes.POSITIVE .. pathPowerStr | ||
| elseif (pathPower < 0 and not displayStat.lowerIsBetter) or (pathPower > 0 and displayStat.lowerIsBetter) then | ||
| pathPowerStr = colorCodes.NEGATIVE .. pathPowerStr | ||
| end | ||
|
|
||
| local effectLabelParts = isAlloc and not node.allMasteryOptions and node.sd or effect.stats or effect.sd |
There was a problem hiding this comment.
This is all the same code as the section above, I think we can combine these sections. At least have a function that they share.
| end | ||
| end | ||
| end | ||
|
|
There was a problem hiding this comment.
I'd prefer to not duplicate this logic, actually.
Fixes #3704 .
Description of the problem being solved:
Masteries are not in the power report
Steps taken to verify a working solution:
Link to a build that showcases this PR:
literally any build
Before screenshot:
After screenshot: