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
 
(44 intermediate revisions by the same user not shown)
Line 1: Line 1:
local tags = {
-- Module:TagCreatures
-- Readonly via mw.loadData in consumers.
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 = {
golem      = { text = 'Golem',            link = 'Golems'            },
text = 'Angelic',
moritost  = { text = 'Moritost',          link = 'Moritost'           },
link = 'Angelic creatures',
ghoul      = { text = 'Ghoul',            link = 'Ghouls'             },
symbol = '😇',
vampire    = { text = 'Vampire',          link = 'Vampires'           },
},
zombie    = { text = 'Zombie',            link = 'Zombies'            },
demonic = {
demon      = { text = 'Demon',            link = 'Demons'            },
text = 'Demonic',
angel      = { text = 'Angel',            link = 'Angels'            },
link = 'Demonic creatures',
wraith    = { text = 'Wraith',            link = 'Wraiths'           },
symbol = '👿',
phraint    = { text = 'Phraint',          link = 'Phraints'           },
},
saurage    = { text = 'Saurage',          link = 'Saurages'          },
elemental = {
human   = { text = 'Human',            link = 'Humans'            },
text = 'Elemental',
bird      = { text = 'Bird',              link = 'Birds'             },
link = 'Elemental creatures',
bovine    = { text = 'Bovine',            link = 'Bovines'           },
symbol = '🌞',
cat        = { text = 'Cat',              link = 'Cats'               },
},
dog        = { text = 'Dog',              link = 'Dogs'              },
plant = {
fish      = { text = 'Fish',              link = 'Fish'              },
text = 'Plant',
amphibian  = { text = 'Amphibian',        link = 'Amphibians'         },
link = 'Plant creatures',
mummy   = { text = 'Mummy',            link = 'Mummies'           },
symbol = '🌿'
drake      = { text = 'Drake',            link = 'Drakes'            },
},
dragon   = { text = 'Dragon',            link = 'Dragons'            },
construct = {
crab      = { text = 'Crab',              link = 'Crabs'              },
text = 'Construct',
insect    = { text = 'Insect',            link = 'Insects'           },
link = 'Construct creatures',
demonfae  = { text = 'Infernal-Faespawn', link = 'Infernal-faespawn' },
symbol = '🗿'
scorpion  = { text = 'Scorpion',          link = 'Scorpions'         },
},
snake      = { text = 'Snake',            link = 'Snakes'            },
draconic = {
spiga      = { text = 'Spiga',            link = 'Spigas'            },
text = 'Draconic',
dragonfly  = { text = 'Dragonfly',        link = 'Dragonflies'       },
link = 'Draconic creatures',
khepra    = { text = 'Khepra Phraint',    link = 'Khepra phraints'   },
symbol = '🐲',
mantis   = { text = 'Mantis Phraint',    link = 'Mantis phraints'   },
},
primate    = { text = 'Primate',          link = 'Primates'          },
fae = {
},
text = 'Fae',
regions = {
link = 'Fae creatures',
southern  = { text = 'Southern Isles',    link = 'Creatures from the Southern Isles' },
symbol = '🧚',
mainland  = { text = 'Mainland',          link = 'Creatures from the mainland'       },
},
mist      = { text = 'Mists',            link = 'Creatures from the Mists'         },
animal = {
dry        = { text = 'Dry Lands',        link = 'Creatures from the Dry Lands'     },
text = 'Animal',
inner      = { text = 'Inner Sea',        link = 'Creatures from the Inner Sea'      },
link = 'Animal creatures',
north      = { text = 'North',             link = 'Creatures from the north'         },
symbol = '🦀',
amon      = { text = 'Amon',              link = 'Creatures from Amon'               },
},
ravina    = { text = 'Ravina',            link = 'Creatures from Ravina'            },
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 = '👤',
},
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 09:50, 7 February 2026

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

-- Module:TagCreatures
-- Readonly via mw.loadData in consumers.
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'         },
		golem      = { text = 'Golem',             link = 'Golems'             },
		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'           },
	},
	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'             },
	}
}