Ad placeholder

Module:DiceUtils: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 36: Line 36:
max_damage = 0
max_damage = 0
if not (frame.args.modifier == nil) then
if not (frame.args.modifier == nil) then
min_damage = min_damage + frame.args.modifier
min_damage = min_damage + tonumber(frame.args.modifier)
max_damage = max_damage + frame.args.modifier
max_damage = max_damage + tonumber(frame.args.modifier)
end
end
Line 52: Line 52:
if not (frame.args.modifier == nil) then
if not (frame.args.modifier == nil) then
if frame.args.modifier > 0 then
damage_str = string.format("%s %d %s", table.concat(dice, " + "), frame.args.modifier, avg_str)
damage_str = string.format("%s +%d %s", table.concat(dice, " + "), frame.args.modifier, avg_str)
else
damage_str = string.format("%s %d %s", table.concat(dice, " + "), frame.args.modifier, avg_str)
end
else
else
damage_str = string.format("%s %s", table.concat(dice, " + "), avg_str)
damage_str = string.format("%s %s", table.concat(dice, " + "), avg_str)

Navigation menu