![]() |
VOOZH | about |
This module implements {{brewing}}.
localp={} locali18n={ defaultBasePotion='Awkward Potion', defaultSplashPotion='Splash $1', defaultLingeringPotion='Lingering $1', specialPotionNames={ ['Any Potion']={'Any Splash Potion','Any Lingering Potion'}, ['Awkward Potion']={'Awkward Splash Potion','Awkward Lingering Potion'}, ['Thick Potion']={'Thick Splash Potion','Thick Lingering Potion'}, ['Mundane Potion']={'Mundane Splash Potion','Mundane Lingering Potion'}, ['Uncraftable Potion']={'Uncraftable Splash Potion','Uncraftable Lingering Potion'}, }, moduleArgs=[[Module:ProcessArgs]], moduleRecipe=[[Module:Recipe table]], type='Brewing', } p.i18n=i18n localrecipeTable=require(i18n.moduleRecipe).table functionp.table(f) localargs=f iff==mw.getCurrentFrame()then args=require(i18n.moduleArgs).merge(true) else f=mw.getCurrentFrame() end args.Input=args[1] args.base1=args.base1orargs.base ifnotargs.base1andnotargs.base2andnotargs.base3then args.base1=i18n.defaultBasePotion end localingredientArgs={'Input','Base1','Base2','Base3'} localoutputArgs={'Output1','Output2','Output3'} ifargs.showvariantsthen ingredientArgs={'Input','Base1'} outputArgs={'Output1'} localbase2={} localbase3={} localoutput2={} localoutput3={} forpotioninmw.text.gsplit(args.base1,'%s*;%s*')do ifi18n.specialPotionNames[potion]then table.insert(base2,i18n.specialPotionNames[potion][1]) table.insert(base3,i18n.specialPotionNames[potion][2]) else localsplash=i18n.defaultSplashPotion:gsub('%$1',potion) locallingering=i18n.defaultLingeringPotion:gsub('%$1',potion) table.insert(base2,splash) table.insert(base3,lingering) end end forpotioninmw.text.gsplit(args[2],'%s*;%s*')do ifi18n.specialPotionNames[potion]then table.insert(output2,i18n.specialPotionNames[potion][1]) table.insert(output3,i18n.specialPotionNames[potion][2]) else localsplash=i18n.defaultSplashPotion:gsub('%$1',potion) locallingering=i18n.defaultLingeringPotion:gsub('%$1',potion) table.insert(output2,splash) table.insert(output3,lingering) end end args.Base1=args.base1 args.Base2=table.concat(base2,';') args.Base3=table.concat(base3,';') args.Output1=args[2] args.Output2=table.concat(output2,';') args.Output3=table.concat(output3,';') else args.Base1=args.base2 args.Base2=args.base1 args.Base3=args.base3 args.Output1=args[3] args.Output2=args[2] args.Output3=args[4] end localout=recipeTable(args,{ uiFunc='brewingStand', type=i18n.type, ingredientArgs=ingredientArgs, outputArgs=outputArgs, }) localtitle=mw.title.getCurrentTitle() returnout end returnp