4,687
edits
(Fixed missing -, cleaned up a bit more) |
(Re-added nil check in the event a non-existent modifier gets pushed) |
||
Line 908: | Line 908: | ||
--Turns a modifier name like 'increasedMeleeAccuracyBonus' into several pieces of data: | --Turns a modifier name like 'increasedMeleeAccuracyBonus' into several pieces of data: | ||
--Base Name, | --Base Name, Description, IsNegative, and modifierData | ||
--ex. "MeleeAccuracyBonus", "+{ | --ex. "MeleeAccuracyBonus", "+${value}% Melee Accuracy Rating", false, table | ||
function p.getModifierDetails(modifierName) | function p.getModifierDetails(modifierName) | ||
local baseName = modifierName | local baseName = modifierName | ||
Line 919: | Line 919: | ||
end | end | ||
--TODO: Is this | if modifier == nil then | ||
return nil | |||
end | |||
--TODO: Is this still needed? | |||
local sign = "+" | local sign = "+" | ||
if string.match(modifier.description, '-${value}') then | if string.match(modifier.description, '-${value}') then | ||
Line 992: | Line 996: | ||
end | end | ||
resultText = string.gsub(resultText, '${(value[^}]*)}', function(rule) return (formatModValue(modMagnitude, rule) or '') end) | |||
resultText = string.gsub(resultText, '${(value[^}]*)}', function(rule) return | |||
if doColor then | if doColor then |