celestian
December 28th, 2019, 02:10
So while working on some documentation I ran across the 5e description of weapon properties.
The weapon's properties should follow those noted in the PHB so that Fantasy Grounds recognises what they mean, Thus the acceptable properties would be, light, finesse, thrown, heavy, two-handed, reach etc. Also record here whether the weapon is magical or is made from rare materials. Acceptable words are magic, silver, adamantine. Properties should be listed separated by commas e.g light, finesse, silver, magic. Two further properties are available 'crit range x' will determine whether this weapon criticals on a number less than 20 (crit range 19 for crit on 19-20); and 'reroll x' where a weapon rerolls damage dice (for example reroll 2 will reroll any 1's and 2's that come up on the damage dice and take the rerolled values).
So, that seems to imply adding "magic,finesse" to the property value of a weapon that the weapon would then act like it was magic on damage? It doesn't appear to do that.
I noticed the same thing in the AD&D ruleset and corrected it. This should work for 5E.
Location: char_weapon.lua
function onDamageAction(draginfo)
local nodeWeapon = getDatabaseNode();
local nodeChar = nodeWeapon.getChild("...")
local rActor = ActorManager.getActor("pc", nodeChar);
local aWeaponProps = StringManager.split(DB.getValue(nodeWeapon, "properties", ""):lower(), ",", true);
local rAction = {};
rAction.bWeapon = true;
rAction.label = DB.getValue(nodeWeapon, "name", "");
if type.getValue() == 0 then
rAction.range = "M";
else
rAction.range = "R";
end
local sBaseAbility = "strength";
if type.getValue() == 1 then
sBaseAbility = "dexterity";
end
-- Check for reroll tag
for _,vProperty in ipairs(aWeaponProps) do
local nPropReroll = tonumber(vProperty:match("reroll (%d+)")) or 0;
if nPropReroll > 0 then
rAction.nReroll = nPropReroll;
end
end
rAction.clauses = {};
local aDamageNodes = UtilityManager.getSortedTable(DB.getChildren(nodeW eapon, "damagelist"));
for _,v in ipairs(aDamageNodes) do
local sDmgAbility = DB.getValue(v, "stat", "");
if sDmgAbility == "base" then
sDmgAbility = sBaseAbility;
end
local nAbilityBonus = ActorManager2.getAbilityBonus(rActor, sDmgAbility);
local nMult = DB.getValue(v, "statmult", 1);
if nAbilityBonus > 0 and nMult ~= 1 then
nAbilityBonus = math.floor(nMult * nAbilityBonus);
end
local aDmgDice = DB.getValue(v, "dice", {});
local aDmgReroll = nil;
if rAction.nReroll then
aDmgReroll = {};
for kDie,vDie in ipairs(aDmgDice) do
aDmgReroll[kDie] = rAction.nReroll;
end
end
local nDmgMod = nAbilityBonus + DB.getValue(v, "bonus", 0);
local sDmgType = DB.getValue(v, "type", "");
-- this will check the properties on the weapon and apply addition damage types found
local aWeaponDamageTypes = StringManager.split(sDmgType,",",true);
for _,sProp in ipairs(aWeaponProps) do
if StringManager.contains(DataCommon.dmgtypes, sProp) and
not StringManager.contains(aWeaponDamageTypes, sProp) then
table.insert(aWeaponDamageTypes, sProp);
end
end
sDmgType = table.concat(aWeaponDamageTypes,", ");
--
table.insert(rAction.clauses, { dice = aDmgDice, stat = sDmgAbility, statmult = nMult, modifier = nDmgMod, dmgtype = sDmgType, reroll = aDmgReroll });
end
ActionDamage.performRoll(draginfo, rActor, rAction);
return true;
end
The bold bit is what I added.
The weapon's properties should follow those noted in the PHB so that Fantasy Grounds recognises what they mean, Thus the acceptable properties would be, light, finesse, thrown, heavy, two-handed, reach etc. Also record here whether the weapon is magical or is made from rare materials. Acceptable words are magic, silver, adamantine. Properties should be listed separated by commas e.g light, finesse, silver, magic. Two further properties are available 'crit range x' will determine whether this weapon criticals on a number less than 20 (crit range 19 for crit on 19-20); and 'reroll x' where a weapon rerolls damage dice (for example reroll 2 will reroll any 1's and 2's that come up on the damage dice and take the rerolled values).
So, that seems to imply adding "magic,finesse" to the property value of a weapon that the weapon would then act like it was magic on damage? It doesn't appear to do that.
I noticed the same thing in the AD&D ruleset and corrected it. This should work for 5E.
Location: char_weapon.lua
function onDamageAction(draginfo)
local nodeWeapon = getDatabaseNode();
local nodeChar = nodeWeapon.getChild("...")
local rActor = ActorManager.getActor("pc", nodeChar);
local aWeaponProps = StringManager.split(DB.getValue(nodeWeapon, "properties", ""):lower(), ",", true);
local rAction = {};
rAction.bWeapon = true;
rAction.label = DB.getValue(nodeWeapon, "name", "");
if type.getValue() == 0 then
rAction.range = "M";
else
rAction.range = "R";
end
local sBaseAbility = "strength";
if type.getValue() == 1 then
sBaseAbility = "dexterity";
end
-- Check for reroll tag
for _,vProperty in ipairs(aWeaponProps) do
local nPropReroll = tonumber(vProperty:match("reroll (%d+)")) or 0;
if nPropReroll > 0 then
rAction.nReroll = nPropReroll;
end
end
rAction.clauses = {};
local aDamageNodes = UtilityManager.getSortedTable(DB.getChildren(nodeW eapon, "damagelist"));
for _,v in ipairs(aDamageNodes) do
local sDmgAbility = DB.getValue(v, "stat", "");
if sDmgAbility == "base" then
sDmgAbility = sBaseAbility;
end
local nAbilityBonus = ActorManager2.getAbilityBonus(rActor, sDmgAbility);
local nMult = DB.getValue(v, "statmult", 1);
if nAbilityBonus > 0 and nMult ~= 1 then
nAbilityBonus = math.floor(nMult * nAbilityBonus);
end
local aDmgDice = DB.getValue(v, "dice", {});
local aDmgReroll = nil;
if rAction.nReroll then
aDmgReroll = {};
for kDie,vDie in ipairs(aDmgDice) do
aDmgReroll[kDie] = rAction.nReroll;
end
end
local nDmgMod = nAbilityBonus + DB.getValue(v, "bonus", 0);
local sDmgType = DB.getValue(v, "type", "");
-- this will check the properties on the weapon and apply addition damage types found
local aWeaponDamageTypes = StringManager.split(sDmgType,",",true);
for _,sProp in ipairs(aWeaponProps) do
if StringManager.contains(DataCommon.dmgtypes, sProp) and
not StringManager.contains(aWeaponDamageTypes, sProp) then
table.insert(aWeaponDamageTypes, sProp);
end
end
sDmgType = table.concat(aWeaponDamageTypes,", ");
--
table.insert(rAction.clauses, { dice = aDmgDice, stat = sDmgAbility, statmult = nMult, modifier = nDmgMod, dmgtype = sDmgType, reroll = aDmgReroll });
end
ActionDamage.performRoll(draginfo, rActor, rAction);
return true;
end
The bold bit is what I added.