71
editsAd placeholder
Module:DiceUtils: Difference between revisions
Jump to navigation
Jump to search
no edit summary
No edit summary |
No edit summary |
||
Line 35: | Line 35: | ||
min_damage = 0 | min_damage = 0 | ||
max_damage = 0 | max_damage = 0 | ||
if not (frame.args.modifier == nil) then | |||
min_damage = min_damage + frame.args.modifier | |||
max_damage = max_damage + frame.args.modifier | |||
end | |||
avg_str = "" | avg_str = "" | ||
for i, die in ipairs(dice) do | for i, die in ipairs(dice) do | ||
Line 44: | Line 49: | ||
avg_str = string.format("(%d~%d)", min_damage, max_damage) | avg_str = string.format("(%d~%d)", min_damage, max_damage) | ||
end | |||
if not (frame.args.modifier == nil) then | |||
damage_str = string.format("%s %d %s", table.concat(dice, " + "), frame.args.modifier, avg_str) | |||
else | |||
damage_str = string.format("%s %s", table.concat(dice, " + "), avg_str) | |||
end | end | ||
if frame.args.append_type then | if frame.args.append_type then | ||
damage_str = string.format("%s %s", damage_str, d_type) | damage_str = string.format("%s %s", damage_str, d_type) |