@@ -180,27 +180,34 @@ data.powerStatList = {
180180
181181--- @param output any Calc output
182182--- @param statTable StatTable Table with stats as in data.powerStatList
183+ --- @param skipTransform ? boolean Whether the stat transform should be skipped. This is useful if you want to e.g. divide two less is better stats
183184--- @return number
184- function data .powerStatList .GetFromOutput (output , statTable )
185- if statTable .stat == " FullDPS" then
186- if output [statTable .stat ] ~= nil then
187- return output [statTable .stat ] or 0
185+ function data .powerStatList .GetFromOutput (output , statTable , skipTransform )
186+ local function getEntry ()
187+ if statTable .stat == " FullDPS" then
188+ if output [statTable .stat ] ~= nil then
189+ return output [statTable .stat ] or 0
190+ end
191+ -- if the user doesn't have full dps, we default to adding the player and minion dps together
192+ return (output .CombinedDPS or 0 ) + (output .Minion and output .Minion .CombinedDPS )
188193 end
189- -- if the user doesn't have full dps, we default to adding the player and minion dps together
190- return (output .CombinedDPS or 0 ) + (output .Minion and output .Minion .CombinedDPS )
191- end
192- -- minion-only stats
193- local minionStat = statTable .stat :match (" ^Minion(.+)" )
194- if minionStat then
195- return output .Minion and output .Minion [minionStat ] or 0
194+ -- minion-only stats
195+ local minionStat = statTable .stat :match (" ^Minion(.+)" )
196+ if minionStat then
197+ return output .Minion and output .Minion [minionStat ] or 0
198+ end
199+ -- damage stats use a combination of player and minion dps
200+ local isDamageStat = statTable .stat == " AverageDamage" or statTable .stat == " TotalDot" or
201+ statTable .stat :match (" DPS" )
202+ if isDamageStat then
203+ return (output [statTable .stat ] or 0 ) + (output .Minion and output .Minion [statTable .stat ] or 0 )
204+ end
205+ return output [statTable .stat ] or 0
196206 end
197- -- damage stats use a combination of player and minion dps
198- local isDamageStat = statTable .stat == " AverageDamage" or statTable .stat == " TotalDot" or
199- statTable .stat :match (" DPS" )
200- if isDamageStat then
201- return (output [statTable .stat ] or 0 ) + (output .Minion and output .Minion [statTable .stat ] or 0 )
207+ if statTable .transform and not skipTransform then
208+ return statTable .transform (getEntry ())
202209 end
203- return output [ statTable . stat ] or 0
210+ return getEntry ()
204211end
205212-- these stats don't exist on minions or generally don't exist on both player and minion
206213local minionNonApplicableStats = {
0 commit comments