Originally Posted by
bwatford
The savage attacker is only rerolling one of the two weapon dice now. Not sure what changed?
Using Greatsword. it only offers to reroll the first of the two d6's rolled.
I fixed it my adding a bit of code to the CountD, also added a check to make sure it ignored other dice that might get added by CT effects, so it only rerolls the weapon dice.
local CountD = 0;
local nOrigClauses = tonumber(rRoll.nOrigClauses) or 1;
local nClauseCount = 0;
local sEffectsExpr = string.match(rRoll.sDesc, "%[EFFECTS (.-)%]") or "";
local aEffectsDice = DiceManager.convertStringToDice(sEffectsExpr) or {};
local nEffectsDice = #aEffectsDice;
for sDmgType, sDmgExpr in string.gmatch(rRoll.sDesc, "%[TYPE:%s*(.-)%s*%(([^)]*)%)%]") do
nClauseCount = nClauseCount + 1;
if nClauseCount > nOrigClauses then break; end
local lowerType = sDmgType:lower();
if string.match(lowerType, "slashing") or string.match(lowerType, "piercing") or string.match(lowerType, "bludgeoning") then
local sDiceExpr = string.match(sDmgExpr, "(.-)=%d*") or sDmgExpr; -- Strip =total if present
local aTempDice = DiceManager.convertStringToDice(sDiceExpr) or {};
CountD = CountD + math.max(0, #aTempDice - nEffectsDice); -- Subtract effects dice
end
end