4,687
edits
(Updated Sign check in getModifierDetails) |
(Removed the need for a modifier Sign) |
||
Line 908: | Line 908: | ||
--Turns a modifier name like 'increasedHPRegenFlat' into several pieces of data: | --Turns a modifier name like 'increasedHPRegenFlat' into several pieces of data: | ||
--Base Name, Description | --Base Name, Description, IsNegative, and modifyValue | ||
--ex. "HPRegenFlat", "+${value} Flat Hitpoints Regeneration" | --ex. "HPRegenFlat", "+${value} Flat Hitpoints Regeneration", false, "multiplyByNumberMultiplier" | ||
function p.getModifierDetails(modifierName) | function p.getModifierDetails(modifierName) | ||
local baseName = modifierName | local baseName = modifierName | ||
local modifier = GameData.rawData.modifierData[modifierName] | local modifier = GameData.rawData.modifierData[modifierName] | ||
Line 921: | Line 920: | ||
if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then | if Shared.startsWith(modifierName, "increased") or Shared.startsWith(modifierName, "decreased") then | ||
baseName = string.sub(modifierName, 10) | baseName = string.sub(modifierName, 10) | ||
end | end | ||
return baseName, modifier.description | return baseName, modifier.description, modifier.isNegative, modifier.modifyValue | ||
end | end | ||
function p._getModifierText(modifier, value, doColor) | function p._getModifierText(modifier, value, doColor) | ||
if doColor == nil then doColor = true end | if doColor == nil then doColor = true end | ||
local modName, modText | local modName, modText, isNegative, modifyValue = p.getModifierDetails(modifier) | ||
if modName == nil then | if modName == nil then |