So I've been working on a macro (5e) to calculate total damage my character does each turn. I play a fighter, and at my current level I can attack up to 6 times a round (with Action Surge). My DM is also looking to modify my macro for multiple people So how its supposed to work is: I roll a bunch of attack rolls, my DM tells me how many times I hit. I then click on the macro, it asks me for the number of hits, then the number of critical hits, and it'll calculate the damage. Currently my macro looks like this:
&{template:simple}
{{rname=@{weapon_name}}}
{{mod=damage}}
{{r1=[[
(?{Number of Hits|0}*@{weapon_dice_num})@{weapon_dice} +
?{Number of Hits}*[[@{weapon_stat}[MOD] +
@{weapon_magic}[Magic]]] +
[[?{Number of Hits|0}*(@{global_damage_mod_roll})]] +
[[?{Number of Crits|0}*@{weapon_dice_num}]]@{weapon_dice} +
]]}}
{{normal=1}}
{{r2=0}}
{{charname=? {Number of Hits}x
hit : ?{Number of Crits}x crit. }}
Using the following attributes to make updating the macro easier: weapon_dice_num: The number of dice I roll for each weapon hit. DM has given basically everyone weapons dealing more than one dice of damage. weapon_dice: The actual dice size (d8, d10, d12). The other attributes aren't important for my question but I'll put what they do here for reference: global_damage_mod_roll is from the sheet and it applies checked global damage modifiers like +10 damage from Great Weapon Mastery. weapon_stat is an user created attribute with a value like @{strength_mod}, this makes it easier for this macro to be used by other characters. For each character, I just create this attribute and drop in the appropriate stat mod: @{dexterity}, etc. weapon_magic is the magic bonus for my current weapon. Is there anyway to simplify this specific line, given a weapon that deals 2d6 damage (weapon_dice_num = 2. weapon_dice = d6): (?{Number of Hits|0}*@{weapon_dice_num})@{weapon_dice} With two hit this becomes (2*2)d6 , which is accurate. But what I really want is to have a single attribute with both the number of dice, and the dice . So something like a weapon_damage attribute = 2d6. I've tried: (?{Number of Hits|0}*@{weapon_damage} But this ends up with 2*2d6, which rolls the 2d6 and multiplies the result by 2. What I want is it to multiply 2*2 and roll 4d6 instead. Preferably while keeping the dice roll visible when I scroll over the roll. Essentially I want expansion to happen first if possible, so in a more general scenario (with a weapon that does an extra 1d8 + 5 on hit): 2*(2d6 + 1d8 + 5) would become 4d6 + 2d8 + 10 before being calculated.