Difference between revisions of "Template:Hunger"
Line 1: | Line 1: | ||
− | {{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}| | + | {{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]] | {{#ifexpr: {{{1}}} = 0 or {{{1}}} < 0 | [[File:ui-hunger-empty.png|12x12px|class=item-icon pixel|link=Hunger]]}}}}{{#ifexpr: {{{1}}} > 1.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 2.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 3.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 4.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 5.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 6.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 7.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 8.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 9.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}<noinclude> |
− | {{#ifexpr: {{{1}}} > 1.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}| | ||
− | {{#ifexpr: {{{1}}} > 9.49 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}| | ||
== About == | == About == | ||
This template serves to display hunger points in a page. | This template serves to display hunger points in a page. | ||
== Usage == | == Usage == | ||
− | The syntax of this template is <code><nowiki>{{Hunger|<number>|<poisoned>?}}</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 hunger icons. It can also round to the nearest integer. When using the <code>poisoned</code> parameter | + | The syntax of this template is <code><nowiki>{{Hunger|<number>|<poisoned>?}}</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 hunger icons. It can also round to the nearest integer. When using the <code>poisoned</code> parameter with the <code>true</code> value, all hunger icons will change to it's poisoned version. |
== Examples == | == Examples == | ||
Line 27: | Line 25: | ||
Poisoned examples: | Poisoned examples: | ||
− | * <code><nowiki>{{Hunger|5|poisoned}}</nowiki></code> → {{Hunger|5|poisoned= | + | * <code><nowiki>{{Hunger|5|poisoned=true}}</nowiki></code> → {{Hunger|5|poisoned=true}} |
− | * <code><nowiki>{{Hunger|6.5|poisoned}}</nowiki></code> → {{Hunger|6.5|poisoned= | + | * <code><nowiki>{{Hunger|6.5|poisoned=true}}</nowiki></code> → {{Hunger|6.5|poisoned=true}} |
− | * <code><nowiki>{{Hunger|3|poisoned}}</nowiki></code> → {{Hunger|3|poisoned= | + | * <code><nowiki>{{Hunger|3|poisoned=true}}</nowiki></code> → {{Hunger|3|poisoned=true}} |
</noinclude> | </noinclude> |
Revision as of 11:50, 5 July 2022
Expression error: Unrecognized punctuation character "{".{{#ifexpr: {{{1}}} > 1.49 | }{{#ifexpr: {{{1}}} > 2.49 | }{{#ifexpr: {{{1}}} > 3.49 | }{{#ifexpr: {{{1}}} > 4.49 | }{{#ifexpr: {{{1}}} > 5.49 | }{{#ifexpr: {{{1}}} > 6.49 | }{{#ifexpr: {{{1}}} > 7.49 | }Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".
About
This template serves to display hunger points in a page.
Usage
The syntax of this template is {{Hunger|<number>|<poisoned>?}}
. If the value given is 0
or lower, it will display nothing, and if the value is higher than 10
, it will display 10 hunger icons. It can also round to the nearest integer. When using the poisoned
parameter with the true
value, all hunger icons will change to it's poisoned version.
Examples
{{Hunger|0}}
→ {{#ifexpr: 0 > 1.49 | }{{#ifexpr: 0 > 2.49 | }{{#ifexpr: 0 > 3.49 | }{{#ifexpr: 0 > 4.49 | }{{#ifexpr: 0 > 5.49 | }{{#ifexpr: 0 > 6.49 | }{{#ifexpr: 0 > 7.49 | }{{Hunger|1}}
→ {{#ifexpr: 1 > 1.49 | }{{#ifexpr: 1 > 2.49 | }{{#ifexpr: 1 > 3.49 | }{{#ifexpr: 1 > 4.49 | }{{#ifexpr: 1 > 5.49 | }{{#ifexpr: 1 > 6.49 | }{{#ifexpr: 1 > 7.49 | }{{Hunger|2}}
→ {{#ifexpr: 2 > 1.49 | }{{#ifexpr: 2 > 2.49 | }{{#ifexpr: 2 > 3.49 | }{{#ifexpr: 2 > 4.49 | }{{#ifexpr: 2 > 5.49 | }{{#ifexpr: 2 > 6.49 | }{{#ifexpr: 2 > 7.49 | }{{Hunger|3}}
→ {{#ifexpr: 3 > 1.49 | }{{#ifexpr: 3 > 2.49 | }{{#ifexpr: 3 > 3.49 | }{{#ifexpr: 3 > 4.49 | }{{#ifexpr: 3 > 5.49 | }{{#ifexpr: 3 > 6.49 | }{{#ifexpr: 3 > 7.49 | }{{Hunger|4}}
→ {{#ifexpr: 4 > 1.49 | }{{#ifexpr: 4 > 2.49 | }{{#ifexpr: 4 > 3.49 | }{{#ifexpr: 4 > 4.49 | }{{#ifexpr: 4 > 5.49 | }{{#ifexpr: 4 > 6.49 | }{{#ifexpr: 4 > 7.49 | }{{Hunger|5}}
→ {{#ifexpr: 5 > 1.49 | }{{#ifexpr: 5 > 2.49 | }{{#ifexpr: 5 > 3.49 | }{{#ifexpr: 5 > 4.49 | }{{#ifexpr: 5 > 5.49 | }{{#ifexpr: 5 > 6.49 | }{{#ifexpr: 5 > 7.49 | }{{Hunger|6}}
→ {{#ifexpr: 6 > 1.49 | }{{#ifexpr: 6 > 2.49 | }{{#ifexpr: 6 > 3.49 | }{{#ifexpr: 6 > 4.49 | }{{#ifexpr: 6 > 5.49 | }{{#ifexpr: 6 > 6.49 | }{{#ifexpr: 6 > 7.49 | }{{Hunger|7}}
→ {{#ifexpr: 7 > 1.49 | }{{#ifexpr: 7 > 2.49 | }{{#ifexpr: 7 > 3.49 | }{{#ifexpr: 7 > 4.49 | }{{#ifexpr: 7 > 5.49 | }{{#ifexpr: 7 > 6.49 | }{{#ifexpr: 7 > 7.49 | }{{Hunger|8}}
→ {{#ifexpr: 8 > 1.49 | }{{#ifexpr: 8 > 2.49 | }{{#ifexpr: 8 > 3.49 | }{{#ifexpr: 8 > 4.49 | }{{#ifexpr: 8 > 5.49 | }{{#ifexpr: 8 > 6.49 | }{{#ifexpr: 8 > 7.49 | }{{Hunger|9}}
→ {{#ifexpr: 9 > 1.49 | }{{#ifexpr: 9 > 2.49 | }{{#ifexpr: 9 > 3.49 | }{{#ifexpr: 9 > 4.49 | }{{#ifexpr: 9 > 5.49 | }{{#ifexpr: 9 > 6.49 | }{{#ifexpr: 9 > 7.49 | }{{Hunger|10}}
→ {{#ifexpr: 10 > 1.49 | }{{#ifexpr: 10 > 2.49 | }{{#ifexpr: 10 > 3.49 | }{{#ifexpr: 10 > 4.49 | }{{#ifexpr: 10 > 5.49 | }{{#ifexpr: 10 > 6.49 | }{{#ifexpr: 10 > 7.49 | }
Rounding examples:
{{Hunger|1.25}}
→ {{#ifexpr: 1.25 > 1.49 | }{{#ifexpr: 1.25 > 2.49 | }{{#ifexpr: 1.25 > 3.49 | }{{#ifexpr: 1.25 > 4.49 | }{{#ifexpr: 1.25 > 5.49 | }{{#ifexpr: 1.25 > 6.49 | }{{#ifexpr: 1.25 > 7.49 | }{{Hunger|1.5}}
→ {{#ifexpr: 1.5 > 1.49 | }{{#ifexpr: 1.5 > 2.49 | }{{#ifexpr: 1.5 > 3.49 | }{{#ifexpr: 1.5 > 4.49 | }{{#ifexpr: 1.5 > 5.49 | }{{#ifexpr: 1.5 > 6.49 | }{{#ifexpr: 1.5 > 7.49 | }{{Hunger|1.75}}
→ {{#ifexpr: 1.75 > 1.49 | }{{#ifexpr: 1.75 > 2.49 | }{{#ifexpr: 1.75 > 3.49 | }{{#ifexpr: 1.75 > 4.49 | }{{#ifexpr: 1.75 > 5.49 | }{{#ifexpr: 1.75 > 6.49 | }{{#ifexpr: 1.75 > 7.49 | }
Poisoned examples:
{{Hunger|5|poisoned=true}}
→ {{#ifexpr: 5 > 1.49 | }{{#ifexpr: 5 > 2.49 | }{{#ifexpr: 5 > 3.49 | }{{#ifexpr: 5 > 4.49 | }{{#ifexpr: 5 > 5.49 | }{{#ifexpr: 5 > 6.49 | }{{#ifexpr: 5 > 7.49 | }{{Hunger|6.5|poisoned=true}}
→ {{#ifexpr: 6.5 > 1.49 | }{{#ifexpr: 6.5 > 2.49 | }{{#ifexpr: 6.5 > 3.49 | }{{#ifexpr: 6.5 > 4.49 | }{{#ifexpr: 6.5 > 5.49 | }{{#ifexpr: 6.5 > 6.49 | }{{#ifexpr: 6.5 > 7.49 | }{{Hunger|3|poisoned=true}}
→ {{#ifexpr: 3 > 1.49 | }{{#ifexpr: 3 > 2.49 | }{{#ifexpr: 3 > 3.49 | }{{#ifexpr: 3 > 4.49 | }{{#ifexpr: 3 > 5.49 | }{{#ifexpr: 3 > 6.49 | }{{#ifexpr: 3 > 7.49 | }