Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?
Printable View
Is this functionality going to be merged into the Vitality/Improved Criticals combo extension as well? If not,is there a way to take advantage of this new update and still use vitality?
OK.. Maybe I'm missing something, but even with my extension disabled, the MAX modifier doesn't seem to work. When I select the "Critical" button, it rolls critical damage, but when I select "Max" or "Critical" AND "Max" it doesn't Max it.
With or without my extension enabled, Half works fine.
Is the MAX modifier broken?
I just tested it with no extensions loaded, MAX works just fine. 2D6+2 MAX CRITICAL returned 4x 6s for a total of 26 damage. 2d6+2 MAX returned 2x 6s for a total of 14 damage.
EDIT:
With just your extension loaded, MAX does not work at all. That is because your mod replaces the onDamageRoll function (which handles MAX) in manager_action_damage.lua.
If you replace your existing ImprovedCritical code with this, it should work fine...NOTE: It does not have the changes from anything after v3 of your extension...
Code:function ImprovedCritical(rSource, rRoll)
-- Handle max damage
local bMax = rRoll.sDesc:match("%[MAX%]");
local bCrit = rRoll.sDesc:match("%[CRITICAL%]");
if bMax then
for _,vDie in ipairs(rRoll.aDice) do
local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
if sDieSides then
local nResult;
if sDieSides == "F" then
nResult = 1;
else
nResult = tonumber(sDieSides) or 0;
end
if sSign == "-" then
nResult = 0 - nResult;
end
vDie.result = nResult;
if sColor == "d" or sColor == "D" then
if sSign == "-" then
vDie.type = "-b" .. sDieSides;
else
vDie.type = "b" .. sDieSides;
end
end
end
end
end
if bCrit then
for _,vDie in ipairs(rRoll.aDice) do
local sSign, sColor, sDieSides = vDie.type:match("^([%-%+]?)([dDrRgGbBpP])([%dF]+)");
if sDieSides then
local nResult = vDie.result;
if sDieSides == "F" then
nResult = 1;
else
if sColor ~= "g" and sColor ~= "G" then
nResult = tonumber(sDieSides) or 0;
end
end
if sSign == "-" then
nResult = 0 - nResult;
end
vDie.result = nResult;
end
end
end
decodeDamageTypes(rRoll, true);
end
Yeah, the MAX modifier works fine with my extension enabled (as of the update I made last night - v 1.6), and it also works when my extension is not loaded at all.
However, when my extension is loaded but disabled (via the settings option), it executes this code ...
ActionsManager.registerPostRollHandler("damage", onDamageRoll);
... which I believe is the default handler. At that point, my extension does not execute (as evidenced by some debug code I add) at all, and damage works normally then, but MAX stops working. HALF continues to work.
Any clues there?
I just got to looking at the recent changes, including how you added options for this mod. You sir, are freaking amazing. I love the customization of this mod!
Thanks Theogeek, for updating. I like the more verbose text in the chatlog, and now Critical and Max work perfectly. But the 5e HALF modifier button doesn't work for me whether I load the extension or not. Weird.
What results do you see? An example from my chatlog:
[DAMAGE] Claw [HALF] [TYPE: slashing (2d6+7=16)]
(that's 2d6 roll of 6 and 3)