Module:Body Part Variants

local p = {}

local variants = { -- Head -- ['Head'] = 'Head', ['Nuclear Protrusion'] = 'Head', ['Central Node'] = 'Head', ['Blossom'] = 'Head', ['Central Lobe'] = 'Head', ['Cap'] = 'Head', ['Top Rail'] = 'Head', ['Header'] = 'Head', ['Skull'] = 'Head', ['Centerpiece'] = 'Head', ['Ear'] = 'Head', ['Pillow'] = 'Head', ['Top'] = 'Head', ['Control Unit'] = 'Head', ['Head Section'] = 'Head', ['Upper Dome'] = 'Head', ['Central Mass'] = 'Head', ['Neck'] = 'Head', -- Face -- ['Face'] = 'Face', ['Antennae'] = 'Face', ['Feelers'] = 'Face', ['Sensor Array'] = 'Face', ['Sensory Bulb'] = 'Face', ['Knocker'] = 'Face', ['Skull Face'] = 'Face', ['Decoration'] = 'Face', ['Splat'] = 'Face', ['Pillowcase'] = 'Face', ['Access Panel'] = 'Face', ['Faceplate'] = 'Face', ['Lip'] = 'Face', ['Extra Face'] = 'Face', ['Sensory Nodule'] = 'Face', ['Sensory Frill'] = 'Face', ['Sensory Ganglion'] = 'Face', -- Back -- ['Back'] = 'Back', ['Chassis'] = 'Back', ['Membrane'] = 'Back', ['Frame'] = 'Back', ['Molding'] = 'Back', ['Breadth'] = 'Back', ['Tablecloth'] = 'Back', ['Blanket'] = 'Back', ['Case'] = 'Back', ['Equipment Rack'] = 'Back', -- Arm -- ['Arm'] = 'Arm', ['Armature'] = 'Arm', ['Leg'] = 'Arm', ['Support Strut'] = 'Arm', ['Frond'] = 'Arm', ['Stem'] = 'Arm', ['Tendril'] = 'Arm', ['Branch'] = 'Arm', ['Lobe'] = 'Arm', ['Taproot'] = 'Arm', ['Stalk'] = 'Arm', ['Fibrous Node'] = 'Arm', ['Hinge'] = 'Arm', ['Stud'] = 'Arm', ['Knot'] = 'Arm', ['Armbone'] = 'Arm', ['Support Pole'] = 'Arm', ['Pipe'] = 'Arm', ['Reinforcement'] = 'Arm', ['Side Rail'] = 'Arm', ['Arm Section'] = 'Arm', ['Robo-Arm'] = 'Arm', -- Hand -- ['Hand'] = 'Hand', ['Manipulator'] = 'Hand', ['Pincer'] = 'Hand', ['Pinnule'] = 'Hand', ['Pseudopod'] = 'Hand', ['Tentacle'] = 'Hand', ['Leaf'] = 'Hand', ['Twig'] = 'Hand', ['Bifurcation'] = 'Hand', ['Fine Root'] = 'Hand', ['Hypha'] = 'Hand', ['Knob'] = 'Hand', ['Small Crack'] = 'Hand', ['Shelf'] = 'Hand', ['Handbone'] = 'Hand', ['Tie Point'] = 'Hand', ['Divider'] = 'Hand', ['Drawer'] = 'Hand', ['Top Drawer'] = 'Hand', ['Bottom Drawer'] = 'Hand', ['Arm Stump'] = 'Hand', ['Side'] = 'Hand', ['Vane'] = 'Hand', ['Rail'] = 'Hand', ['Hand Section'] = 'Hand', ['Opening'] = 'Hand', ['Handle'] = 'Hand', ['Robo-Hand'] = 'Hand', -- Hands -- ['Hands'] = 'Hands', ['Manipulators'] = 'Hands', ['Pincers'] = 'Hands', ['Pseudopods'] = 'Hands', ['Tentacles'] = 'Hands', ['Side Fins'] = 'Hands', ['Leaves'] = 'Hands', ['Twigs'] = 'Hands', ['Bifurcations'] = 'Hands', ['Lateral Hyphae'] = 'Hands', ['Knobs'] = 'Hands', ['Handbones'] = 'Hands', ['Arm Stumps'] = 'Hands', ['Sides'] = 'Hands', ['Vanes'] = 'Hands', ['Rails'] = 'Hands', ['Hand Sections'] = 'Hands', ['Robo-Hands'] = 'Hands', -- Feet -- ['Feet'] = 'Feet', ['Legs'] = 'Feet', ['Support Struts'] = 'Feet', ['Undercarriage'] = 'Feet', ['Bottom Rail'] = 'Feet', ['Foundation'] = 'Feet', ['Base'] = 'Feet', ['Footbones'] = 'Feet', ['Front Legs'] = 'Feet', ['Rear Legs'] = 'Feet', ['Rockers'] = 'Feet', ['Bottom'] = 'Feet', -- Roots -- ['Roots'] = 'Roots', ['Lower Hyphae'] = 'Roots', ['Stakes'] = 'Roots', ['Mulch'] = 'Roots', -- Tread -- ['Tread'] = 'Tread', ['Wheels'] = 'Tread', -- Fin -- ['Fin'] = 'Fin', ['Dorsal Fin'] = 'Fin', ['Tail Fin'] = 'Fin', -- Missile Weapon -- ['Missile Weapon'] = 'Missile Weapon', ['Hardpoint'] = 'Missile Weapon', ['Cybernetic Arm'] = 'Missile Weapon', -- Thrown Weapon -- ['Thrown Weapon'] = 'Thrown Weapon', ['Middle Hardpoint'] = 'Thrown Weapon' }

function p.gettype(part) return variants[part] end

function p.gettypeframe(frame) return p.gettype(frame.args[1]) end

function p.listallvariantsoftype(type) -- returns a string of a list of all body parts that are a variant of the base type. returntbl = {} for v, p in pairs(variants) do       if p == type then --if the base type is the same, return it            returntbl[#returntbl + 1] = v        end end return table.concat(returntbl, ', ') end

function p.listvariants(frame) return p.listallvariantsoftype(frame.args[1]) end

return p