More actions
Content deleted Content added
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
Line 1: | Line 1: | ||
return { |
|||
local tags = { |
|||
traits = { |
traits = { |
||
undead = { text = 'Undead', link = 'Undead creatures', symbol = '🪦' }, |
|||
undead = { |
|||
corporeal = { text = 'Corporeal', link = 'Corporeal undead creatures', symbol = '🧟♀️' }, |
|||
text = 'Undead', |
|||
skeletal = { text = 'Skeletal', link = 'Skeletal undead creatures', symbol = '🦴' }, |
|||
spectral = { text = 'Spectral', link = 'Spectral undead creatures', symbol = '👻' }, |
|||
symbol = '🪦', |
|||
minor = { text = 'Minor', link = 'Minor undead creatures', symbol = '🧟' }, |
|||
}, |
|||
full = { text = 'Full', link = 'Full undead creatures', symbol = '💀' }, |
|||
corporeal = { |
|||
greater = { text = 'Greater', link = 'Greater undead creatures', symbol = '🧛' }, |
|||
text = 'Corporeal', |
|||
outsider = { text = 'Outsider', link = 'Outsider creatures', symbol = '👽️' }, |
|||
angelic = { text = 'Angelic', link = 'Angelic creatures', symbol = '😇' }, |
|||
symbol = '🧟♀️', |
|||
demonic = { text = 'Demonic', link = 'Demonic creatures', symbol = '👿' }, |
|||
}, |
|||
elemental = { text = 'Elemental', link = 'Elemental creatures', symbol = '🌞' }, |
|||
skeletal = { |
|||
plant = { text = 'Plant', link = 'Plant creatures', symbol = '🌿' }, |
|||
text = 'Skeletal', |
|||
construct = { text = 'Construct', link = 'Construct creatures', symbol = '🗿' }, |
|||
draconic = { text = 'Draconic', link = 'Draconic creatures', symbol = '🐲' }, |
|||
symbol = '🦴', |
|||
fae = { text = 'Fae', link = 'Fae creatures', symbol = '🧚' }, |
|||
}, |
|||
animal = { text = 'Animal', link = 'Animal creatures', symbol = '🦀' }, |
|||
spectral = { |
|||
common = { text = 'Common', link = 'Common animal creatures', symbol = '🐾' }, |
|||
text = 'Spectral', |
|||
ooze = { text = 'Ooze', link = 'Ooze creatures', symbol = '💩' }, |
|||
monstrous = { text = 'Monstrous', link = 'Monstrous creatures', symbol = '🧌' }, |
|||
symbol = '👻', |
|||
humanoid = { text = 'Humanoid', link = 'Humanoid creatures', symbol = '👤' }, |
|||
}, |
|||
partial = { text = 'Partial', link = 'Partial humanoid creatures', symbol = '🐒' }, |
|||
minor = { |
|||
aquatic = { text = 'Aquatic', link = 'Aquatic creatures', symbol = '🐟️' }, |
|||
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 = '👽️', |
|||
}, |
|||
angelic = { |
|||
text = 'Angelic', |
|||
link = 'Angelic creatures', |
|||
symbol = '😇', |
|||
}, |
|||
demonic = { |
|||
text = 'Demonic', |
|||
link = 'Demonic 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 = '👤', |
|||
}, |
|||
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 |
Revision as of 19:03, 12 August 2025
Documentation for this module may be created at Module:TagCreatures/doc
return {
traits = {
undead = { text = 'Undead', link = 'Undead 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 = '👽️' },
angelic = { text = 'Angelic', link = 'Angelic creatures', symbol = '😇' },
demonic = { text = 'Demonic', link = 'Demonic 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 = '👤' },
partial = { text = 'Partial', link = 'Partial humanoid creatures', symbol = '🐒' },
aquatic = { text = 'Aquatic', link = 'Aquatic creatures', symbol = '🐟️' },
}
}