Module:Body Part Variants: Difference between revisions

From Caves of Qud Wiki
Jump to navigation Jump to search
mNo edit summary
(add variants list)
Line 132: Line 132:
function p.gettypeframe(frame)
function p.gettypeframe(frame)
   return p.gettype(frame.args[1])
   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.listallvariantsotype(frame.args[1])
end
end


return p
return p

Revision as of 20:36, 21 September 2020


local p = {}

local variants = {['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',
['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',
['Chassis'] = 'Back',
['Membrane'] = 'Back',
['Frame'] = 'Back',
['Molding'] = 'Back',
['Breadth'] = 'Back',
['Tablecloth'] = 'Back',
['Blanket'] = 'Back',
['Case'] = 'Back',
['Equipment Rack'] = 'Back',
['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',
['Manipulator'] = 'Hand',
['Pincer'] = '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',
['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',
['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',
['Lower Hyphae'] = 'Roots',
['Stakes'] = 'Roots',
['Mulch'] = 'Roots',
['Wheels'] = 'Tread',
['Dorsal Fin'] = 'Fin',
['Tail Fin'] = 'Fin',
['Hardpoint'] = 'Missile Weapon',
['Cybernetic Arm'] = 'Missile 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.listallvariantsotype(frame.args[1])
end

return p