Module:Enemy Icon/doc
Cached copy of the original page · revision 1659980 · refresh
This is the documentation page for Enemy Icon. It contains usage information, categories, and other content not part of the original module page. | ||
|---|---|---|
| Main | Documentation | Usage |

Module for {{Enemy Icon}} and for the enemy cells of {{Questbody}}.
The module has two entry points.
main is {{Enemy Icon}}. It turns an enemy's article name into that enemy's icon, File:NameIcon.png, linked to the article. A / in the name becomes -, and so does a : together with the space after it: Beast III/R gives File:Beast III-RIcon.png, and Beast IV: L gives File:Beast IV-LIcon.png. The icon is wrapped in <span class="enemy_icon">, and inum adds a {{Inum}} caption. Other modules call the same code as _main with a table of arguments.
questbody is called by {{Questbody}} once for each enemy, as {{#invoke:Enemy Icon|questbody|23}} for en23. It reads en23, en23icon, en23stage and en23stats from the Questbody call and returns the cell as {{Questbodyenemy}} shows it, each part on its own line:
- the icon (see below);
- the name: the part of
en23before the first;; en23stats, when set;- the stats: the part between the first and the second
;. Text after a second;is dropped.
An empty en23 returns nothing, which is how Questbodyenemy knows how many enemies a row has.
The cell is split here rather than with #explode. #explode stops with "String exceeds 1,000 character limit" on longer text, such as a cell with several {{HPBar}}s, and removes <nowiki/> and similar tags from the text.
Questbody icons
- The icon is that of
en23iconwhen set, otherwise that of the first article link in the name. Links to files, categories and other wikis are skipped, so text in front of the enemy's link is fine. - A playable Servant (a key of Module:Servant Icon/data) gets the frameless
{{Servant Icon}}(rawimage=y) at stageen23stage. Any other page gets the iconmainmakes. Both are 50px. The icon links to the page the name links to, even whenen23iconnames another page; a name without a link gives an icon linked to theen23iconpage. - Nothing checks that the file exists: that is an expensive call, and a page can hold hundreds of enemies. A link to a page without an icon, such as a redirect, shows a broken file and puts the page in Category:Pages with broken file links.
- The pages in
QUESTBODY_NO_ICONS, at the top of the module, get no icons. A page goes there when its icons would push its post-expand include size past the wiki's 2 MB limit, past which the rest of the page is no longer rendered; each icon adds a few hundred bytes. Add a page that lands in Category:Pages where template include size is exceeded. To show icons on it again, split it into subpages, as Main Quest: Id and Main Quest: Avalon le Fae/Part II were.
Uses Module:Arguments, Module:Servant Icon, Module:Servant Icon/data and {{Inum}}.
To update:
QUESTBODY_NO_ICONSin this module: pages that show no Questbody icons
The parameters are documented at Template:Enemy Icon and, for the enemy cells, at Template:Questbody#Enemy icons.