Repository: PathOfBuildingCommunity/PathOfBuilding
File: src/Modules/CalcOffence.lua (Lua)

Code before:
					end
					t_insert(globalBreakdown.BleedStackPotential,s_format("/ %d ^8(max number of stacks)", maxStacks))
					t_insert(globalBreakdown.BleedStackPotential,s_format("= %.2f", globalOutput.BleedStackPotential))
				end
			end

			-- the amount of damage each bleed does as % maximum
			local bleedRollAverage
			if globalOutput.BleedStackPotential > 1 then
				-- shift damage towards top of range as only top bleeds apply
				bleedRollAverage = globalOutput.BleedStackPotential / (globalOutput.BleedStackPotential + 1) * 100
			else
				-- assume middle of range for hit damage
				bleedRollAverage = 50
			end
			globalOutput.BleedRollAverage = bleedRollAverage
			if globalBreakdown then
				globalBreakdown.BleedRollAverage = {
					s_format(colorCodes.CUSTOM.."This is the average roll of a Bleed affecting the enemy if you are constantly attacking"),
					s_format(colorCodes.CUSTOM.."If attacking constantly, your average strongest bleed currently achieves ^7%.2f%%"..colorCodes.CUSTOM.." of its max damage", bleedRollAverage),
					s_format(""),
					s_format("Average Bleed Roll:"),
				}
				if(bleedStacks >= maxStacks) then
					t_insert(globalBreakdown.BleedRollAverage, s_format("%.2f / %.2f ^8Stack Potential / (Stack Potential + 1)", globalOutput.BleedStackPotential, globalOutput.BleedStackPotential + 1))
					t_insert(globalBreakdown.BleedRollAverage, s_format("= %.2f%%", bleedRollAverage))
				else
					t_insert(globalBreakdown.BleedRollAverage, "50% (averaging <= 1 bleed)")
				end
			end

			for sub_pass = 1, 2 do
				if skillModList:Flag(dotCfg, "AilmentsAreNeverFromCrit") or sub_pass == 1 then
					dotCfg.skillCond["CriticalStrike"] = false
				else
					dotCfg.skillCond["CriticalStrike"] = true
				end
				local min, max = calcAilmentSourceDamage(activeSkill, output, dotCfg, sub_pass == 1 and breakdown and breakdown.BleedPhysical, "Physical", 0)
				output.BleedPhysicalMin = min
				output.BleedPhysicalMax = max
				if sub_pass == 2 then
					output.CritBleedDotMulti = 1 + (skillModList:Override(dotCfg, "DotMultiplier") or skillModList:Sum("BASE", dotCfg, "DotMultiplier") + skillModList:Sum("BASE", dotCfg, "PhysicalDotMultiplier")) / 100
					sourceMinCritDmg = min * output.CritBleedDotMulti
					sourceMaxCritDmg = max * output.CritBleedDotMulti
					avgCritBleedDmg = (sourceMinCritDmg + (sourceMaxCritDmg - sourceMinCritDmg) * bleedRollAverage / 100)
				else
					output.BleedDotMulti = 1 + (skillModList:Override(dotCfg, "DotMultiplier") or skillModList:Sum("BASE", dotCfg, "DotMultiplier") + skillModList:Sum("BASE", dotCfg, "PhysicalDotMultiplier")) / 100
					sourceMinHitDmg = min * output.BleedDotMulti
					sourceMaxHitDmg = max * output.BleedDotMulti
					avgHitBleedDmg = (sourceMinHitDmg + (sourceMaxHitDmg - sourceMinHitDmg) * bleedRollAverage / 100)
				end

Review comment (suggestion):
This change should also be done on ignites which uses the same `local igniteRollAverage = igniteStacks / (igniteStacks + 1) * 100`

Code after:

			-- ratio of bleeds applied : max effective bleeds
			globalOutput.BleedStackPotential = overrideStackPotential or (bleedStacks / maxStacks)

			if globalBreakdown then
				globalBreakdown.BleedStackPotential = {"Ratio of bleed stacks to maximum active bleeds:"}
				if overrideStackPotential then
					t_insert(globalBreakdown.BleedStackPotential, s_format("= %g ^8(stack potential override)", overrideStackPotential))
				else
					t_insert(globalBreakdown.BleedStackPotential, s_format("%.2f ^8(chance to hit)", output.HitChance / 100))
					t_insert(globalBreakdown.BleedStackPotential, s_format("* %.2f ^8(chance to bleed)", bleedChance))
					if (globalOutput.HitSpeed or globalOutput.Speed) > 0 then
						t_insert(globalBreakdown.BleedStackPotential, s_format("* (%.2f / %.2f) ^8(Bleed duration / Attack Time)", globalOutput.BleedDuration, (output.HitTime or output.Time)))
					end
					if skillData.dpsMultiplier ~= 1 then
						t_insert(globalBreakdown.BleedStackPotential, s_format("* %g ^8(DPS multiplier for this skill)", skillData.dpsMultiplier))
					end
					if skillFlags.totem then
						t_insert(globalBreakdown.BleedStackPotential, s_format("* %d ^8(active number of Totems)", activeTotems))
					end
					t_insert(globalBreakdown.BleedStackPotential,s_format("/ %d ^8(max number of stacks)", maxStacks))
					t_insert(globalBreakdown.BleedStackPotential,s_format("= %.2f", globalOutput.BleedStackPotential))
				end
			end

			-- the amount of damage each bleed does as % maximum
			local bleedRollAverage
			if globalOutput.BleedStackPotential > 1 then
				-- shift damage towards top of range as only top bleeds apply
				bleedRollAverage = (bleedStacks - (maxStacks - 1)/2) / (bleedStacks + 1) * 100
			else
				-- assume middle of range for hit damage
				bleedRollAverage = 50
			end
			globalOutput.BleedRollAverage = bleedRollAverage
			if globalBreakdown then
				globalBreakdown.BleedRollAverage = {
					s_format(colorCodes.CUSTOM.."This is the average roll of a Bleed affecting the enemy if you are constantly attacking"),
					s_format(colorCodes.CUSTOM.."If attacking constantly, your average strongest bleed currently achieves ^7%.2f%%"..colorCodes.CUSTOM.." of its max damage", bleedRollAverage),
					s_format(""),
					s_format("Average Bleed Roll:"),
				}
				if(bleedStacks >= maxStacks) then
					t_insert(globalBreakdown.BleedRollAverage, s_format("%.2f - (%.2f - 1)/2", bleedStacks, maxStacks))
					t_insert(globalBreakdown.BleedRollAverage, s_format("/ (%.2f + 1)", bleedStacks))
					t_insert(globalBreakdown.BleedRollAverage, s_format("= %.2f%%", bleedRollAverage))
				else
					t_insert(globalBreakdown.BleedRollAverage, s_format("50%% (averaging <= %d bleeds)", maxStacks))
				end
			end