Module:CryptogullJrOld: Difference between revisions

wikid
(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  
       print("The genotype code " .. genotypeC .. " does not exist!")
       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
       print("Couldn't find subtype " ..subtypeC)
       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  
     print("This build code is too short(<8 chars)!")
     error("This build code is too short(<8 chars)!",0)
   end
   end
end  
end  
Line 287: Line 287:
end
end


function p.MakeUpSheet(code, geno, subtype, classcalled, extname,attributes, bonus,exts, unstables)
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]} }


print("Code: " .. code:upper())
print("Genotype: " .. geno)
print(""..classcalled .. subtype[1])
print("Strength: " .. tostring((attributes[1])..bonus[1].. " Agility: " .. tostring(attributes[2])..bonus[2]))
print("Toughness: " .. attributes[3] ..bonus[3] .. " Intelligence: " .. attributes[4]..bonus[4])
print("Willpower: " .. attributes[5] ..bonus[5].. " Ego: " .. attributes[6]..bonus[6])
local mutstring = ""
for _,ext in ipairs(exts) do
mutstring = mutstring .. ", "..ext[1]
end
end
print(extname .. mutstring:sub(3))
print("Skills: " .. subtype[8])
print(subtype[14])


end
return p