8,756
edits
m (Teamtoto moved page Module:CryptogullJr to Module:CryptogullJrOld without leaving a redirect) |
mNo edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
local decode = require'Module:CryptogullJr/Codes' | local decode = require'Module:CryptogullJr/Codes' | ||
local utilTable = require('Module:Table Utility') | |||
function p.Main(frame) | function p.Main(frame) | ||
local buildcode = | local buildcode = frame.args['code'] | ||
local beta = frame.args['beta'] or '1' | local beta = frame.args['beta'] or '1' | ||
return p.decode(buildcode, beta, | local title = frame.args['title'] | ||
return p.decode(buildcode, beta, title) | |||
end | end | ||
function p.decode(buildcode, beta, | function p.decode(buildcode, beta, title) | ||
local genotype | local genotype | ||
local subtype | local subtype | ||
Line 28: | Line 30: | ||
if (genotypeC == 'a') then | if (genotypeC == 'a') then | ||
genotype = "True Kin" | genotype = "True Kin" | ||
classcalled = "Caste | classcalled = "Caste" | ||
extname = "Implants | extname = "Implants" | ||
subtype = decode.TrueKinSubtype(subtypeC) | subtype = decode.TrueKinSubtype(subtypeC) | ||
elseif (genotypeC == 'b') then | elseif (genotypeC == 'b') then | ||
genotype = "Mutated Human" | genotype = "Mutated Human" | ||
classcalled = "Calling | classcalled = "Calling" | ||
extname = "Mutations: " | extname = "Mutations: " | ||
subtype = decode.MutantSubtype(subtypeC) | subtype = decode.MutantSubtype(subtypeC) | ||
Line 70: | Line 72: | ||
else | else | ||
previouscode = chars | previouscode = chars | ||
exts[i] = decode.getexts(chars, subtypeC) | exts[i] = decode.getexts(chars, subtypeC)[1] | ||
i = i + 1 | i = i + 1 | ||
end | end | ||
Line 80: | Line 82: | ||
attributes = p.fixattributes(bonus, attributes) | attributes = p.fixattributes(bonus, attributes) | ||
end | end | ||
output = p.MakeUpSheet(buildcode, genotype, subtype, | |||
classcalled, extname, attributes, bonus, exts, title) | |||
return output | return output | ||
end | end | ||
Line 147: | Line 146: | ||
end | end | ||
function p.MakeUpSheet(codeIn, genoIn, subtype, classcalledIn, extnameIn, attributes, bonus, | function p.MakeUpSheet(codeIn, genoIn, subtype, classcalledIn, extnameIn, | ||
attributes, bonus, exts, title) | |||
local frame = mw.getCurrentFrame() | |||
return frame:expandTemplate { | return frame:expandTemplate { | ||
title = 'Crypto result', | title = 'Crypto result', | ||
Line 167: | Line 163: | ||
ego = attributes[6] .. bonus[6], | ego = attributes[6] .. bonus[6], | ||
extname = extnameIn, | extname = extnameIn, | ||
exts = | exts = utilTable.concat(exts, "</br>"), | ||
skills = subtype[8], | skills = subtype[8], | ||
notes = subtype[14] | notes = subtype[14], | ||
buildname = title, | |||
author = "Legacy Build Code" | |||
} | } | ||
} | } | ||
end | end | ||
function p.test() | |||
return p.Main({["args"]={"BGMMMKMKBABJBPD1", ["beta"]=1}}) | |||
end | |||
return p | return p |