Difference between revisions of "Template:Armor"

From Mine Blocks Wiki
Jump to navigation Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!

(Allowing to display 10 icons in a row because otherwise it can become confusing)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#ifexpr: {{{1}}} > 0 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 1.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 2.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 3.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 4.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 5.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 6.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 7.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 8.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}{{#ifexpr: {{{1}}} > 9.49 | [[File:ui-armor.png|12x12px|class=item-icon pixel|link=Armor]]}}<noinclude>
+
<includeonly>{{#switch: {{{1}}}
 +
| 0 = 0 ([[File:ui-armor-empty.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|0 armor points]])
 +
| 1 = 1 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|1 armor point]])
 +
| 2 = 2 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|2 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|2 armor points]])
 +
| 3 = 3 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|3 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|3 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|3 armor points]])
 +
| 4 = 4 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|4 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|4 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|4 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|4 armor points]])
 +
| 5 = 5 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|5 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|5 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|5 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|5 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|5 armor points]])
 +
| 6 = 6 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|6 armor points]])
 +
| 7 = 7 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|7 armor points]])
 +
| 8 = 8 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|8 armor points]])
 +
| 9 = 9 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|9 armor points]])
 +
| 10 = 10 ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]][[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|10 armor points]])
 +
| #default = {{{1}}} ([[File:ui-armor.png|{{{2|12x12px}}}|class=item-icon pixel|alt=🛡|link=|1 armor point]] × {{{1}}})
 +
}}</includeonly><noinclude>
 
== About ==
 
== About ==
 
This template serves to display armor points in a page.
 
This template serves to display armor points in a page.
  
 
== Usage ==
 
== Usage ==
The syntax of this template is <code><nowiki>{{Armor|<number>}}</nowiki></code>. If the value given is <code>0</code> or lower, it will display nothing, and if the value is higher than <code>10</code>, it will display 10 armor icons. It can also round to the nearest integer.
+
The syntax of this template is <code><nowiki>{{Armor|<number>|<size>}}</nowiki></code>. If the value is higher than <code>10</code>, it will display <code><nowiki>n × <armor></nowiki></code> where <code>n</code> is the number you specified.
  
 
== Examples ==
 
== Examples ==
Line 14: Line 27:
 
* <code><nowiki>{{Armor|5}}</nowiki></code> → {{Armor|5}}
 
* <code><nowiki>{{Armor|5}}</nowiki></code> → {{Armor|5}}
 
* <code><nowiki>{{Armor|6}}</nowiki></code> → {{Armor|6}}
 
* <code><nowiki>{{Armor|6}}</nowiki></code> → {{Armor|6}}
* <code><nowiki>{{Armor|7}}</nowiki></code> → {{Armor|7}}
 
* <code><nowiki>{{Armor|8}}</nowiki></code> → {{Armor|8}}
 
* <code><nowiki>{{Armor|9}}</nowiki></code> → {{Armor|9}}
 
* <code><nowiki>{{Armor|10}}</nowiki></code> → {{Armor|10}}
 
  
 
Rounding examples:
 
Rounding examples:
Line 23: Line 32:
 
* <code><nowiki>{{Armor|1.5}}</nowiki></code> → {{Armor|1.5}}
 
* <code><nowiki>{{Armor|1.5}}</nowiki></code> → {{Armor|1.5}}
 
* <code><nowiki>{{Armor|1.75}}</nowiki></code> → {{Armor|1.75}}
 
* <code><nowiki>{{Armor|1.75}}</nowiki></code> → {{Armor|1.75}}
 +
 +
More than 20 armor points:
 +
* <code><nowiki>{{Armor|20.5}}</nowiki></code> → {{Armor|20.5}}
 +
* <code><nowiki>{{Armor|30}</nowiki></code> → {{Armor|30}}
 +
* <code><nowiki>{{Armor|600}}</nowiki></code> → {{Armor|600}}
 +
 +
Custom icon size:
 +
* <code><nowiki>{{Armor|6|16x16px}}</nowiki></code> → {{Armor|6|16x16px}}
 
</noinclude>
 
</noinclude>

Latest revision as of 19:53, 10 October 2022

About

This template serves to display armor points in a page.

Usage

The syntax of this template is {{Armor|<number>|<size>}}. If the value is higher than 10, it will display n × <armor> where n is the number you specified.

Examples

  • {{Armor|0}} → 0 (🛡)
  • {{Armor|1}} → 1 (🛡)
  • {{Armor|2}} → 2 (🛡🛡)
  • {{Armor|3}} → 3 (🛡🛡🛡)
  • {{Armor|4}} → 4 (🛡🛡🛡🛡)
  • {{Armor|5}} → 5 (🛡🛡🛡🛡🛡)
  • {{Armor|6}} → 6 (🛡🛡🛡🛡🛡🛡)

Rounding examples:

  • {{Armor|1.25}} → 1.25 (🛡 × 1.25)
  • {{Armor|1.5}} → 1.5 (🛡 × 1.5)
  • {{Armor|1.75}} → 1.75 (🛡 × 1.75)

More than 20 armor points:

  • {{Armor|20.5}} → 20.5 (🛡 × 20.5)
  • {{Armor|30} → 30 (🛡 × 30)
  • {{Armor|600}} → 600 (🛡 × 600)

Custom icon size:

  • {{Armor|6|16x16px}} → 6 (🛡🛡🛡🛡🛡🛡)