8,756
edits
(Created page with "local p = {} function p.Main(frame) local buildcode=string.lower(frame.args[1]) local genotype local subtype local classcalled local extname local attributes = {}...") |
(wikid) |
||
Line 25: | Line 25: | ||
subtype = p.MutantSubtype(subtypeC) | subtype = p.MutantSubtype(subtypeC) | ||
else | else | ||
error ("The genotype code " .. genotypeC .. " does not exist!",0) | |||
end | end | ||
--[Check if subtype worked] | --[Check if subtype worked] | ||
if (subtype == nil) then | if (subtype == nil) then | ||
error("Couldn't find subtype " ..subtypeC, 0) | |||
else | else | ||
--[get attributes and put it in a table] | --[get attributes and put it in a table] | ||
Line 57: | Line 57: | ||
end | end | ||
else | else | ||
error("This build code is too short(<8 chars)!",0) | |||
end | end | ||
end | end | ||
Line 287: | Line 287: | ||
end | end | ||
function p.MakeUpSheet(code, | function p.MakeUpSheet(codeIn, genoIn, subtype, classcalledIn, extnameIn,attributes, bonus,extsIn) | ||
frame:expandTemplate{ title = 'Crypto result', | |||
args = { | |||
code=CodeIn:upper(), | |||
genotype=genoIn, | |||
classcalled=classcalledIn, | |||
class=subtype[1], | |||
strength=tostring(attributes[1])..bonus[1], | |||
agility=tostring(attributes[2])..bonus[2], | |||
toughness=attributes[3] ..bonus[3], | |||
intelligence=attributes[4]..bonus[4], | |||
willpower=attributes[5] ..bonus[5], | |||
ego=attributes[6]..bonus[6], | |||
extname=extnameIn, | |||
exts=mw.text.listToText(extsIn, ', ', ', '), | |||
skills=subtype[8], | |||
notes=subtype[14]} } | |||
end | end | ||
return p |