Module:Creature Mutation Query: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 28: Line 28:
limit= '1'
limit= '1'
}
}
local cost, type = tonumber(util_cargo.queryAndCast(query)[1]["Cost"]), util_cargo.queryAndCast(query)[1]["Type"]
-- Try to find a mutation with this name, if not, just return the name unlinked.
result = util_cargo.queryAndCast(query)[1]
local parentheses = ""
 
if not next(result) then
else
local cost, type = tonumber(util_cargo.queryAndCast(result["Cost"])), result[1]["Type"]
     local isDefect = false
     local isDefect = false
     local isMental = false
     local isMental = false
Line 36: Line 42:
     end
     end
     local modifier = math.floor((ego-16)/2)
     local modifier = math.floor((ego-16)/2)
    local parentheses = ""
 
 
   if isDefect then
   if isDefect then
     parentheses ='<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#a64a2e;">D</span><span style="color:#b1c9c3;">)</b>'
     parentheses ='<b><span style="color:#b1c9c3;">&nbsp;(</span><span style="color:#a64a2e;">D</span><span style="color:#b1c9c3;">)</b>'
Line 54: Line 59:
   parentheses = parentheses .. ")</span></b>"
   parentheses = parentheses .. ")</span></b>"
   end
   end
 
end
-- formatting
local mutationString = mw.html.create('div')
local mutationString = mw.html.create('div')
mutationString
mutationString