Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:TagCreatures: Difference between revisions

From Teriock
// via Wikitext Extension for VSCode
 
No edit summary
 
(47 intermediate revisions by the same user not shown)
Line 1: Line 1:
local tags = {
return {
traits = {
traits = {
undead = {
undead     = { text = 'Undead',           link = 'Undead creatures',           symbol = '🪦' },
text = 'Undead',
beast      = { text = 'Beast',            link = 'Beast creatures',            symbol = '🦣' },
link = 'Undead creatures',
corporeal   = { text = 'Corporeal',       link = 'Corporeal undead creatures', symbol = '🧟' },
symbol = '🪦',
skeletal   = { text = 'Skeletal',         link = 'Skeletal undead creatures', symbol = '🦴' },
},
spectral   = { text = 'Spectral',         link = 'Spectral undead creatures', symbol = '👻' },
corporeal = {
minor       = { text = 'Minor',           link = 'Minor undead creatures',     symbol = '🧟' },
text = 'Corporeal',
full       = { text = 'Full',             link = 'Full undead creatures',     symbol = '💀' },
link = 'Corporeal undead creatures',
greater    = { text = 'Greater',          link = 'Greater undead creatures',  symbol = '🧛' },
symbol = '🧟‍♀️',
outsider    = { text = 'Outsider',        link = 'Outsider creatures',        symbol = '👽️' },
},
celestial  = { text = 'Celestial',        link = 'Celestial creatures',        symbol = '😇' },
skeletal = {
infernal    = { text = 'Infernal',        link = 'Infernal creatures',        symbol = '👿' },
text = 'Skeletal',
elemental  = { text = 'Elemental',        link = 'Elemental creatures',        symbol = '🌞' },
link = 'Skeletal undead creatures',
plant      = { text = 'Plant',            link = 'Plant creatures',            symbol = '🌿' },
symbol = '🦴',
construct  = { text = 'Construct',        link = 'Construct creatures',        symbol = '🗿' },
},
draconic    = { text = 'Draconic',        link = 'Draconic creatures',        symbol = '🐲' },
spectral = {
fae        = { text = 'Fae',              link = 'Fae creatures',              symbol = '🧚' },
text = 'Spectral',
animal      = { text = 'Animal',          link = 'Animal creatures',          symbol = '🦀' },
link = 'Spectral undead creatures',
common      = { text = 'Common',          link = 'Common animal creatures',    symbol = '🐾' },
symbol = '👻',
ooze        = { text = 'Ooze',            link = 'Ooze creatures',            symbol = '💩' },
},
monstrous  = { text = 'Monstrous',        link = 'Monstrous creatures',        symbol = '🧌' },
minor = {
humanoid    = { text = 'Humanoid',        link = 'Humanoid creatures',        symbol = '👤' },
text = 'Minor',
pc          = { text = 'Playable',        link = 'Player character creatures', symbol = '🧍' },
link = 'Minor undead creatures',
partial    = { text = 'Partial Humanoid', link = 'Partial humanoid creatures', symbol = '🐒' },
symbol = '🧟',
aquatic    = { text = 'Aquatic',          link = 'Aquatic creatures',          symbol = '🐟️' },
},
avian      = { text = 'Avian',            link = 'Avian creatures',            symbol = '🦅' },
full = {
fungus      = { text = 'Fungus',          link = 'Fungus creatures',          symbol = '🍄' },
text = 'Full',
pund        = { text = 'Partial Undead',  link = 'Partial undead creatures',  symbol = '🫀' },
link = 'Full undead creatures',
},
symbol = '💀',
types = {
},
goblin      = { text = 'Goblin',            link = 'Goblins'          },
greater = {
ork        = { text = 'Ork',              link = 'Orks'              },
text = 'Greater',
ogre        = { text = 'Ogre',              link = 'Ogres'             },
link = 'Greater undead creatures',
dwarf      = { text = 'Dwarf',            link = 'Dwarves'          },
symbol = '🧛',
elf        = { text = 'Elf',              link = 'Elves'            },
},
troll      = { text = 'Troll',            link = 'Trolls'           },
outsider = {
giant      = { text = 'Giant',            link = 'Giants'           },
text = 'Outsider',
spider      = { text = 'Spider',            link = 'Spiders'           },
link = 'Outsider creatures',
golem      = { text = 'Golem',            link = 'Golems'            },
symbol = '👽️',
treant      = { text = 'Treant',            link = 'Treants'          },
},
drakespawn  = { text = 'Drakespawn',        link = 'Drakespawn'       },
angelic = {
moritost    = { text = 'Moritost',          link = 'Moritost'          },
text = 'Angelic',
ghoul      = { text = 'Ghoul',            link = 'Ghouls'           },
link = 'Angelic creatures',
vampire    = { text = 'Vampire',          link = 'Vampires'         },
symbol = '😇',
zombie      = { text = 'Zombie',            link = 'Zombies'          },
},
demon      = { text = 'Demon',            link = 'Demons'            },
demonic = {
angel      = { text = 'Angel',            link = 'Angels'           },
text = 'Demonic',
wraith      = { text = 'Wraith',            link = 'Wraiths'           },
link = 'Demonic creatures',
phraint    = { text = 'Phraint',          link = 'Phraints'         },
symbol = '👿',
saurage    = { text = 'Saurage',          link = 'Saurages'          },
},
human      = { text = 'Human',            link = 'Humans'            },
elemental = {
bird        = { text = 'Bird',              link = 'Birds'             },
text = 'Elemental',
bovine      = { text = 'Bovine',            link = 'Bovines'           },
link = 'Elemental creatures',
cat        = { text = 'Cat',              link = 'Cats'             },
symbol = '🌞',
dog        = { text = 'Dog',              link = 'Dogs'              },
},
fish        = { text = 'Fish',              link = 'Fish'              },
plant = {
amphibian  = { text = 'Amphibian',        link = 'Amphibians'       },
text = 'Plant',
mummy      = { text = 'Mummy',            link = 'Mummies'           },
link = 'Plant creatures',
drake      = { text = 'Drake',            link = 'Drakes'           },
symbol = '🌿'
dragon      = { text = 'Dragon',            link = 'Dragons'          },
},
crab        = { text = 'Crab',              link = 'Crabs'            },
construct = {
insect      = { text = 'Insect',            link = 'Insects'           },
text = 'Construct',
demonfae    = { text = 'Infernal-Faespawn', link = 'Infernal-faespawn' },
link = 'Construct creatures',
scorpion    = { text = 'Scorpion',          link = 'Scorpions'         },
symbol = '🗿'
snake      = { text = 'Snake',            link = 'Snakes'            },
},
spiga      = { text = 'Spiga',            link = 'Spigas'            },
draconic = {
dragonfly  = { text = 'Dragonfly',        link = 'Dragonflies'       },
text = 'Draconic',
khepra      = { text = 'Khepra Phraint',    link = 'Khepra phraints'   },
link = 'Draconic creatures',
mantis      = { text = 'Mantis Phraint',    link = 'Mantis phraints'   },
symbol = '🐲',
primate    = { text = 'Primate',          link = 'Primates'          },
},
rodent      = { text = 'Rodent',            link = 'Rodents'          },
fae = {
ape        = { text = 'Ape',              link = 'Apes'             },
text = 'Fae',
bear        = { text = 'Bear',              link = 'Bears'             },
link = 'Fae creatures',
equine      = { text = 'Equine',            link = 'Equines'           },
symbol = '🧚',
deer        = { text = 'Deer',              link = 'Deer'              },
},
camelid    = { text = 'Camelid',          link = 'Camelids'          },
animal = {
swine      = { text = 'Swine',            link = 'Swine'             },
text = 'Animal',
elephant    = { text = 'Elephant',          link = 'Elephants'         },
link = 'Animal creatures',
cetacean    = { text = 'Cetacean',          link = 'Cetaceans'         },
symbol = '🦀',
pinniped    = { text = 'Pinniped',          link = 'Pinnipeds'        },
},
cephalopod  = { text = 'Cephalopod',        link = 'Cephalopods'      },
common = {
mustelid    = { text = 'Mustelid',          link = 'Mustelids'         },
text = 'Common',
crocodilian = { text = 'Crocodilian',      link = 'Crocodilians'     },
link = 'Common animal creatures',
lizard      = { text = 'Lizard',            link = 'Lizards'           },
symbol = '🐾',
turtle      = { text = 'Turtle',            link = 'Turtles'          },
},
insectivore = { text = 'Insectivore',      link = 'Insectivores'      },
ooze = {
marsupial  = { text = 'Marsupial',        link = 'Marsupials'       },
text = 'Ooze',
},
link = 'Ooze creatures',
regions = {
symbol = '💩',
southern    = { text = 'Southern Isles', link = 'Creatures from the Southern Isles' },
},
mainland    = { text = 'Mainland',      link = 'Creatures from the mainland'       },
monstrous = {
mist        = { text = 'Mists',          link = 'Creatures from the Mists'          },
text = 'Monstrous',
dry        = { text = 'Dry Lands',      link = 'Creatures from the Dry Lands'      },
link = 'Monstrous creatures',
inner      = { text = 'Inner Sea',      link = 'Creatures from the Inner Sea'     },
symbol = '🧌',
north      = { text = 'North',          link = 'Creatures from the north'         },
},
amon        = { text = 'Amon',          link = 'Creatures from Amon'               },
humanoid = {
ravina      = { text = 'Ravina',        link = 'Creatures from Ravina'            },
text = 'Humanoid',
},
link = 'Humanoid creatures',
symbol = '👤',
},
partial = {
text = 'Partial',
link = 'Partial humanoid creatures',
symbol = '🐒',
},
aquatic = {
text = 'Aquatic',
link = 'Aquatic creatures',
symbol = '🐟️',
},
}
}
}
local function makeTag(frame, key, value, makeCat, transparent)
    if not tags[key] or not tags[key][value] then
        if value then
            local out = frame:preprocess("{{ucfirst:" .. tostring(value) .. "}}")
-- local out = 'pranked'
            if not ('.' == out:sub(-1)) then
                out = out .. '.'
            end
            return out
        else
            return ''
        end
    end
    local tag = tags[key][value]
    if tag.no then
        local out = frame:preprocess("{{ucfirst:" .. tag.text .. "}}")
        if not ('.' == out:sub(-1)) then
            out = out .. '.'
        end
        return out
    end
    if tag.tags then
        local out = ''
        for _, t in ipairs(tag.tags) do
            out = out .. makeTag(frame, key, t, makeCat, transparent)
        end
        return out
    end
    local tagText = "{{Tag|{{ucfirst:" .. tag.text .. "}}"
    if tag.symbol then
        tagText = tagText .. "|" .. tag.symbol
    end
    if tag.link then
        tagText = tagText .. "|l=:Category:{{ucfirst:" .. tag.link .. "}}"
    end
    if tag.color then
        tagText = tagText .. "|c=" .. tag.color
    end
    if transparent then
        tagText = tagText .. "|o=1"
    end
    tagText = tagText .. "}}"
    -- out = frame:preprocess(tagText)
    out = tagText
    return out
end

Latest revision as of 02:15, 5 November 2026

Documentation for this module may be created at Module:TagCreatures/doc

return {
	traits = {
		undead      = { text = 'Undead',           link = 'Undead creatures',           symbol = '🪦' },
		beast       = { text = 'Beast',            link = 'Beast creatures',            symbol = '🦣' },
		corporeal   = { text = 'Corporeal',        link = 'Corporeal undead creatures', symbol = '🧟' },
		skeletal    = { text = 'Skeletal',         link = 'Skeletal undead creatures',  symbol = '🦴' },
		spectral    = { text = 'Spectral',         link = 'Spectral undead creatures',  symbol = '👻' },
		minor       = { text = 'Minor',            link = 'Minor undead creatures',     symbol = '🧟' },
		full        = { text = 'Full',             link = 'Full undead creatures',      symbol = '💀' },
		greater     = { text = 'Greater',          link = 'Greater undead creatures',   symbol = '🧛' },
		outsider    = { text = 'Outsider',         link = 'Outsider creatures',         symbol = '👽️' },
		celestial   = { text = 'Celestial',        link = 'Celestial creatures',        symbol = '😇' },
		infernal    = { text = 'Infernal',         link = 'Infernal creatures',         symbol = '👿' },
		elemental   = { text = 'Elemental',        link = 'Elemental creatures',        symbol = '🌞' },
		plant       = { text = 'Plant',            link = 'Plant creatures',            symbol = '🌿' },
		construct   = { text = 'Construct',        link = 'Construct creatures',        symbol = '🗿' },
		draconic    = { text = 'Draconic',         link = 'Draconic creatures',         symbol = '🐲' },
		fae         = { text = 'Fae',              link = 'Fae creatures',              symbol = '🧚' },
		animal      = { text = 'Animal',           link = 'Animal creatures',           symbol = '🦀' },
		common      = { text = 'Common',           link = 'Common animal creatures',    symbol = '🐾' },
		ooze        = { text = 'Ooze',             link = 'Ooze creatures',             symbol = '💩' },
		monstrous   = { text = 'Monstrous',        link = 'Monstrous creatures',        symbol = '🧌' },
		humanoid    = { text = 'Humanoid',         link = 'Humanoid creatures',         symbol = '👤' },
		pc          = { text = 'Playable',         link = 'Player character creatures', symbol = '🧍' },
		partial     = { text = 'Partial Humanoid', link = 'Partial humanoid creatures', symbol = '🐒' },
		aquatic     = { text = 'Aquatic',          link = 'Aquatic creatures',          symbol = '🐟️' },
		avian       = { text = 'Avian',            link = 'Avian creatures',            symbol = '🦅' },
		fungus      = { text = 'Fungus',           link = 'Fungus creatures',           symbol = '🍄' },
		pund        = { text = 'Partial Undead',   link = 'Partial undead creatures',   symbol = '🫀' },
	},
	types = {
		goblin      = { text = 'Goblin',            link = 'Goblins'           },
		ork         = { text = 'Ork',               link = 'Orks'              },
		ogre        = { text = 'Ogre',              link = 'Ogres'             },
		dwarf       = { text = 'Dwarf',             link = 'Dwarves'           },
		elf         = { text = 'Elf',               link = 'Elves'             },
		troll       = { text = 'Troll',             link = 'Trolls'            },
		giant       = { text = 'Giant',             link = 'Giants'            },
		spider      = { text = 'Spider',            link = 'Spiders'           },
		golem       = { text = 'Golem',             link = 'Golems'            },
		treant      = { text = 'Treant',            link = 'Treants'           },
		drakespawn  = { text = 'Drakespawn',        link = 'Drakespawn'        },
		moritost    = { text = 'Moritost',          link = 'Moritost'          },
		ghoul       = { text = 'Ghoul',             link = 'Ghouls'            },
		vampire     = { text = 'Vampire',           link = 'Vampires'          },
		zombie      = { text = 'Zombie',            link = 'Zombies'           },
		demon       = { text = 'Demon',             link = 'Demons'            },
		angel       = { text = 'Angel',             link = 'Angels'            },
		wraith      = { text = 'Wraith',            link = 'Wraiths'           },
		phraint     = { text = 'Phraint',           link = 'Phraints'          },
		saurage     = { text = 'Saurage',           link = 'Saurages'          },
		human       = { text = 'Human',             link = 'Humans'            },
		bird        = { text = 'Bird',              link = 'Birds'             },
		bovine      = { text = 'Bovine',            link = 'Bovines'           },
		cat         = { text = 'Cat',               link = 'Cats'              },
		dog         = { text = 'Dog',               link = 'Dogs'              },
		fish        = { text = 'Fish',              link = 'Fish'              },
		amphibian   = { text = 'Amphibian',         link = 'Amphibians'        },
		mummy       = { text = 'Mummy',             link = 'Mummies'           },
		drake       = { text = 'Drake',             link = 'Drakes'            },
		dragon      = { text = 'Dragon',            link = 'Dragons'           },
		crab        = { text = 'Crab',              link = 'Crabs'             },
		insect      = { text = 'Insect',            link = 'Insects'           },
		demonfae    = { text = 'Infernal-Faespawn', link = 'Infernal-faespawn' },
		scorpion    = { text = 'Scorpion',          link = 'Scorpions'         },
		snake       = { text = 'Snake',             link = 'Snakes'            },
		spiga       = { text = 'Spiga',             link = 'Spigas'            },
		dragonfly   = { text = 'Dragonfly',         link = 'Dragonflies'       },
		khepra      = { text = 'Khepra Phraint',    link = 'Khepra phraints'   },
		mantis      = { text = 'Mantis Phraint',    link = 'Mantis phraints'   },
		primate     = { text = 'Primate',           link = 'Primates'          },
		rodent      = { text = 'Rodent',            link = 'Rodents'           },
		ape         = { text = 'Ape',               link = 'Apes'              },
		bear        = { text = 'Bear',              link = 'Bears'             },
		equine      = { text = 'Equine',            link = 'Equines'           },
		deer        = { text = 'Deer',              link = 'Deer'              },
		camelid     = { text = 'Camelid',           link = 'Camelids'          },
		swine       = { text = 'Swine',             link = 'Swine'             },
		elephant    = { text = 'Elephant',          link = 'Elephants'         },
		cetacean    = { text = 'Cetacean',          link = 'Cetaceans'         },
		pinniped    = { text = 'Pinniped',          link = 'Pinnipeds'         },
		cephalopod  = { text = 'Cephalopod',        link = 'Cephalopods'       },
		mustelid    = { text = 'Mustelid',          link = 'Mustelids'         },
		crocodilian = { text = 'Crocodilian',       link = 'Crocodilians'      },
		lizard      = { text = 'Lizard',            link = 'Lizards'           },
		turtle      = { text = 'Turtle',            link = 'Turtles'           },
		insectivore = { text = 'Insectivore',       link = 'Insectivores'      },
		marsupial   = { text = 'Marsupial',         link = 'Marsupials'        },
	},
	regions = {
		southern    = { text = 'Southern Isles', link = 'Creatures from the Southern Isles' },
		mainland    = { text = 'Mainland',       link = 'Creatures from the mainland'       },
		mist        = { text = 'Mists',          link = 'Creatures from the Mists'          },
		dry         = { text = 'Dry Lands',      link = 'Creatures from the Dry Lands'      },
		inner       = { text = 'Inner Sea',      link = 'Creatures from the Inner Sea'      },
		north       = { text = 'North',          link = 'Creatures from the north'          },
		amon        = { text = 'Amon',           link = 'Creatures from Amon'               },
		ravina      = { text = 'Ravina',         link = 'Creatures from Ravina'             },
	},
}