Difference between revisions of "Template:Monster"

From NetHackWiki
Jump to navigation Jump to search
(Links)
(here goes - please revert if it does break anything)
 
Line 4: Line 4:
 
<div class="monsterbasic" style="display:none; border:none; margin:0; padding:0;">
 
<div class="monsterbasic" style="display:none; border:none; margin:0; padding:0;">
 
{|class="prettytable" style="border:none; margin:0; padding:0; width:22em;"
 
{|class="prettytable" style="border:none; margin:0; padding:0; width:22em;"
!colspan="2" style="font-size:larger;"|{{ #if: {{{symbol|}}} | {{{symbol}}} | {{#if: {{{name|}}} | {{monsym|{{#replace:{{lc:{{{name}}}}}| |_}}}} | {{monsym|{{PAGENAMEE}}}} }} }} {{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }} {{ #if: {{{tile|}}} | {{{tile}}} | [[Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png]] }}
+
!colspan="2" style="font-size:larger;"|{{ #if: {{{symbol|}}} | {{{symbol}}} | {{#if: {{{name|}}} | {{monsym|{{#replace:{{lc:{{{name}}}}}| |_}}}} | {{monsym|{{PAGENAMEE}}}} }} }} {{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }} {{ #if: {{{tile|}}} | {{{tile}}} | {{LinklessExists|Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png | [[Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png]] | ''(No tile)'' [[Category:Monsters missing tiles]] }} }}
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
!'''[[Monster difficulty|Difficulty]]'''
 
!'''[[Monster difficulty|Difficulty]]'''
Line 16: Line 16:
 
</div><div class="monsterfull" style="border:none; margin:0px; padding:0px;">
 
</div><div class="monsterfull" style="border:none; margin:0px; padding:0px;">
 
{|class="prettytable" style="border:none; margin:0; padding:0; width:22em;"
 
{|class="prettytable" style="border:none; margin:0; padding:0; width:22em;"
!colspan="2" style="font-size:larger;"|{{ #if: {{{symbol|}}} | {{{symbol}}} | {{#if: {{{name|}}} | {{monsym|{{#replace:{{lc:{{{name}}}}}| |_}}}} | {{monsym|{{PAGENAMEE}}}} }} }} {{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }} {{ #if: {{{tile|}}} | {{{tile}}} | [[Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png]] }}
+
!colspan="2" style="font-size:larger;"|{{ #if: {{{symbol|}}} | {{{symbol}}} | {{#if: {{{name|}}} | {{monsym|{{#replace:{{lc:{{{name}}}}}| |_}}}} | {{monsym|{{PAGENAMEE}}}} }} }} {{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }} {{ #if: {{{tile|}}} | {{{tile}}} | {{LinklessExists|Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png | [[Image:{{ #if: {{{name|}}} | {{{name}}} | {{lcfirst:{{PAGENAME}}}} }}.png]] | ''(No tile)'' [[Category:Monsters missing tiles]]}} }}
 
|- style="vertical-align: top;"
 
|- style="vertical-align: top;"
 
! '''[[Monster difficulty|Difficulty]]'''
 
! '''[[Monster difficulty|Difficulty]]'''

Latest revision as of 09:10, 24 June 2024

Put this template at the top of every monster page. The following example from the killer bee article shows how to call this template, the result being shown on your right:

{{monster
 |name=killer bee
 |symbol={{yellow|a}}
 |tile=[[Image:killer bee.png]]
 |difficulty=5
 |level=1
 |experience=19
 |speed=18
 |AC=−1
 |MR=0
 |align=0
 |frequency=Rare
 |genocidable=Yes
 |attacks=Sting 1d3 [[poison]]ous
 |weight=1
 |nutr=5
 |size=Tiny
 |resistances=Poison
 |resistances conveyed=Poison (30%)
 |attributes={{attributes|A killer bee|=
 |lgroup=1|animal=1|fly=1|nohands=1|pois=1|hostile=1|female=1}}
 |refline=104
}}

The name and tile parameters do not need to be used if name matches the article's title. symbol can be omitted, in which case the template uses name, or if that is missing, then the article title, to find the correct symbol.

The first line of the attributes parameter should be A <monster> for most monsters, but <Monster> for unique monsters with names.

The attributes and refline parameters are defined as optional in the template so that this template could be backward-compatible with pages that were not updated yet to use these new parameters. All pages using this template should be updated to use the new parameters, as shown in the above example.