Module:Endless Petals

local petal = {}

petal.apothecary = function(f) local args = f.args or f	if f == mw.getCurrentFrame then args = f:getParent.args else f = mw.getCurrentFrame end page = " " .. f:expandTemplate{title="Cg", args={nil, 209, 218}} .. f:expandTemplate{title="Cg", args={"bg-image", "GUI Petal Apothecary.png"}} .. f:expandTemplate{title="Cg", args={"text", require("Module:Language").link({"Petal Apothecary", --"Petal Apothecary"--}), nil, nil, 0, 4, class="craftingGridText craftingGridLink craftingGridTitle"}} num = 1 stuff = {} while args["I" .. num] ~= nil do table.insert(stuff, args["I" .. num]) num = num + 1 end if #stuff > 0 then num = 360 / (num-1) for i, gc in ipairs(stuff) do page = page .. f:expandTemplate{title="Cg", args={"cell", gc, 67, 116, style=ring(num, i)}} end end return page .. f:expandTemplate{title="Cg", args={"cell", args.O or "", 143, 45}} .. " "	end function ring(number, offset) return "transform: rotate(" .. ((number or 0) * (offset or 0)) .. "deg) translate(64px) rotate(" .. ((-number or 0) * (offset or 0)) .. "deg);" end

return petal