Module:Sandbox/Constants: Difference between revisions

Small cleanup, added note for why modifierTypes is still needed
(Removed the need for a modifier Sign)
(Small cleanup, added note for why modifierTypes is still needed)
Line 5: Line 5:


--Just hardcoding these because I guess that's where we're at
--Just hardcoding these because I guess that's where we're at
--getModifierSkills still needs skills, otherwise this can be removed
local modifierTypes = {
local modifierTypes = {
["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus from Equipment", skills = {'Combat'} },
["MeleeStrengthBonus"] = { text = "{V}% Melee Strength Bonus from Equipment", skills = {'Combat'} },
Line 944: Line 945:
['(value)=>Math.pow(2,value)'] = function(val) return 2^val end,
['(value)=>Math.pow(2,value)'] = function(val) return 2^val end,
['(value)=>game.golbinRaid.startingWeapons[value].name'] = function(val)
['(value)=>game.golbinRaid.startingWeapons[value].name'] = function(val)
-- For golbin raid starting weapons
-- For golbin raid starting weapons
local startingWeapons = { 'melvorD:Bronze_Scimitar', 'melvorD:Adamant_Scimitar' }
local startingWeapons = { 'melvorD:Bronze_Scimitar', 'melvorD:Adamant_Scimitar' }
local itemID = startingWeapons[val + 1]
local itemID = startingWeapons[val + 1]
local item = GameData.getEntityByID('items', itemID)
local item = GameData.getEntityByID('items', itemID)
if item ~= nil then
if item ~= nil then
return item.name
return item.name
else
else
return 'Unknown'
return 'Unknown'
end
end
end
end
}
}
local ruleFunc = ruleFunctions[modifyValue] or ruleFunctions['value']
local ruleFunc = ruleFunctions[modifyValue] or ruleFunctions['value']
Line 987: Line 988:
end
end


resultText = string.gsub(resultText, '${(value[^}]*)}', function(rule) return (formatModValue(modMagnitude, rule) or '') end)
resultText = string.gsub(resultText, '${value}', function(rule) return (formatModValue(modMagnitude, rule) or '') end)


if doColor then
if doColor then
463

edits