Difference between revisions of "Template:EdibilityGrid"
Jump to navigation
Jump to search
Margotbean (talk | contribs) (1 too many </div>s) |
Margotbean (talk | contribs) (update) |
||
Line 1: | Line 1: | ||
− | <includeonly><table class="no-wrap" style="text-align: left; border-spacing: 0;"> | + | <includeonly>{{#ifeq:{{lc:{{{dsv|}}}}}|false||<span style="display: none;">data-sort-value="{{{2|}}}"</span>}}<!-- |
+ | --><table class="no-wrap" style="text-align: left; margin: 0; padding: 0; border-spacing: 0; border: 0;"> | ||
+ | {{#if:{{#pos:{{{hide|}}}|normal}}|| | ||
+ | {{#switch:{{{quality|all}}} | ||
+ | |normal|base|all|0 = | ||
<tr> | <tr> | ||
− | + | {{#ifeq:{{lc:{{{showitem|false}}}}}|false|| | |
− | < | + | <td style="padding-right: 4px;">{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=0}}</td>}} |
− | + | <td>{{#ifexpr: {{{2|0}}} < 0 | |
− | + | |{{Overlayimg|Poison|width=20|center=true|type=star|quality=0}} | |
− | + | |{{Overlayimg|Energy|width=20|center=true|type=star|quality=0}}}}</td> | |
− | + | <td style="vertical-align: bottom; padding-right: 6px;">{{#replace:{{#invoke:Calcedibility|ce | |
− | + | |im = energy <!-- energy or health --> | |
− | + | |ed = {{{2|0}}} <!-- edibility --> | |
− | + | |q = 0 <!-- quality --> | |
− | + | |ll = {{CONTENTLANG}} <!-- local language --> | |
− | + | }}|-|−}}</td> | |
− | + | ||
− | + | <td>{{Overlayimg|Health|width=20|center=true|type=star|quality=0}}</td> | |
− | + | <td style="vertical-align: bottom;">{{#if:{{{health|}}}|{{{health|}}}|{{#ifexpr: {{{2|0}}} < 0 | |
− | + | |0 | |
− | + | |{{#invoke:Calcedibility|ce | |
− | + | |im = health <!-- energy or health --> | |
− | + | |ed = {{{2|0}}} <!-- edibility --> | |
− | + | |q = 0 <!-- quality --> | |
− | + | |ll = {{CONTENTLANG}} <!-- local language --> | |
− | + | }} }} }}</td> | |
− | + | </tr>}} }}{{#if:{{#pos:{{{hide|}}}|silver}}||{{#switch:{{lc:{{{1|}}}}} | |
− | {{# | + | |juice|oil|cave carrot|green tea|ginger|sap|green algae|white algae|qi fruit= |
− | + | |#default= | |
− | + | {{#switch:{{{quality|all}}} | |
− | <td>{{ | + | |silver|all|1 = |
− | <td style="vertical-align: bottom | + | <tr> |
− | + | {{#ifeq:{{lc:{{{showitem|false}}}}}|false|| | |
− | + | <td style="padding-right: 4px;">{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=1}}</td>}} | |
− | + | <td>{{#ifexpr: {{{2|0}}} < 0 | |
− | + | |{{Overlayimg|Poison|width=20|center=true|type=star|quality=1}} | |
− | + | |{{Overlayimg|Energy|width=20|center=true|type=star|quality=1}}}} | |
− | {{# | + | </td> |
− | + | <td style="vertical-align: bottom; padding-right: 6px;">{{#replace:{{#invoke:Calcedibility|ce | |
− | + | |im = energy <!-- energy or health --> | |
− | + | |ed = {{{2|0}}} <!-- edibility --> | |
− | + | |q = 1 <!-- quality --> | |
− | + | |ll = {{CONTENTLANG}} <!-- local language --> | |
− | + | }}|-|−}}</td> | |
− | + | ||
− | + | <td>{{Overlayimg|Health|width=20|center=true|type=star|quality=1}}</td> | |
− | + | <td style="vertical-align: bottom;">{{#ifexpr: {{{2|0}}} < 0 | |
− | + | |0 | |
− | </td> | + | |{{#invoke:Calcedibility|ce |
− | </tr> | + | |im = health <!-- energy or health --> |
+ | |ed = {{{2|0}}} <!-- edibility --> | ||
+ | |q = 1 <!-- quality --> | ||
+ | |ll = {{CONTENTLANG}} <!-- local language --> | ||
+ | }}</td>}} | ||
+ | </tr>}} }} }}{{#if:{{#pos:{{{hide|}}}|gold}}||{{#switch:{{lc:{{{1|}}}}} | ||
+ | |juice|oil|cave carrot|green tea|ginger|sap|green algae|white algae|qi fruit= | ||
+ | |#default= | ||
+ | {{#switch:{{{quality|all}}} | ||
+ | |gold|all|2 = | ||
+ | <tr> | ||
+ | {{#ifeq:{{lc:{{{showitem|false}}}}}|false|| | ||
+ | <td style="padding-right: 4px;">{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=2}}</td>}} | ||
+ | <td>{{#ifexpr: {{{2|0}}} < 0 | ||
+ | |{{Overlayimg|Poison|width=20|center=true|type=star|quality=2}} | ||
+ | |{{Overlayimg|Energy|width=20|center=true|type=star|quality=2}}}} | ||
+ | </td> | ||
+ | <td style="vertical-align: bottom; padding-right: 6px;">{{#replace:{{#invoke:Calcedibility|ce | ||
+ | |im = energy <!-- energy or health --> | ||
+ | |ed = {{{2|0}}} <!-- edibility --> | ||
+ | |q = 2 <!-- quality --> | ||
+ | |ll = {{CONTENTLANG}} <!-- local language --> | ||
+ | }}|-|−}}</td> | ||
+ | |||
+ | <td>{{Overlayimg|Health|width=20|center=true|type=star|quality=2}}</td> | ||
+ | <td style="vertical-align: bottom;">{{#ifexpr: {{{2|0}}} < 0 | ||
+ | |0 | ||
+ | |{{#invoke:Calcedibility|ce | ||
+ | |im = health <!-- energy or health --> | ||
+ | |ed = {{{2|0}}} <!-- edibility --> | ||
+ | |q = 2 <!-- quality --> | ||
+ | |ll = {{CONTENTLANG}} <!-- local language --> | ||
+ | }}</td>}} | ||
+ | </tr>}} }} }}{{#if:{{#pos:{{{hide|}}}|iridium}}||{{#switch:{{lc:{{{1|}}}}} | ||
+ | |juice|oil|cave carrot|green tea|ginger|sap|green algae|white algae|qi fruit= | ||
+ | |#default= | ||
+ | {{#switch:{{{quality|all}}} | ||
+ | |iridium|all|4 = | ||
+ | <tr> | ||
+ | {{#ifeq:{{lc:{{{showitem|false}}}}}|false|| | ||
+ | <td style="padding-right: 4px;">{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=4}}</td>}} | ||
+ | <td>{{#ifexpr: {{{2|0}}} < 0 | ||
+ | |{{Overlayimg|Poison|width=20|center=true|type=star|quality=4}} | ||
+ | |{{Overlayimg|Energy|width=20|center=true|type=star|quality=4}}}} | ||
+ | </td> | ||
+ | <td style="vertical-align: bottom; padding-right: 6px;">{{#replace:{{#invoke:Calcedibility|ce | ||
+ | |im = energy <!-- energy or health --> | ||
+ | |ed = {{{2|0}}} <!-- edibility --> | ||
+ | |q = 4 <!-- quality --> | ||
+ | |ll = {{CONTENTLANG}} <!-- local language --> | ||
+ | }}|-|−}}</td> | ||
+ | |||
+ | <td>{{Overlayimg|Health|width=20|center=true|type=star|quality=4}}</td> | ||
+ | <td style="vertical-align: bottom;">{{#ifexpr: {{{2|0}}} < 0 | ||
+ | |0 | ||
+ | |{{#invoke:Calcedibility|ce | ||
+ | |im = health <!-- energy or health --> | ||
+ | |ed = {{{2|0}}} <!-- edibility --> | ||
+ | |q = 4 <!-- quality --> | ||
+ | |ll = {{CONTENTLANG}} <!-- local language --> | ||
+ | }}</td>}} | ||
+ | </tr>}} }} }} | ||
</table></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> | </table></includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> |
Latest revision as of 16:36, 28 February 2023
Description
This template displays a grid of energy and health values for an edible item.
Parameters
Parameter | Notes |
---|---|
First (unnamed) parameter | Name of image (minus ".png") |
Second (unnamed) parameter | Edibility of item (can be found in ObjectInformation.xnb) Items with a negative edibility will display the poison icon instead of the energy icon. |
quality | Single quality to display. Defaults to all qualities (normal, silver, gold, iridium) if omitted. Items that exist in normal quality only do not have to specify quality=normal (i.e., Cave Carrot, Ginger, Green Algae, Green Tea, Juice, Oil, Qi Fruit, Sap, and White Algae) Note: Other items may be added in the future. In the meantime, specifying quality=normal will work.
|
hide | Qualities to hide (e.g., hide=silver,gold) |
showitem | Set to true to display the image of the edible item |
dsv | data-sort-value Set to false if the energy & health values are displayed in a non-sortable structure (like an infobox) Default value is true (the entire parameter can be omitted if a data-sort-value is desired). |
health | Use to override the normal calculation for health, when the normal formula does not apply (e.g., for Bug Steak and Oil of Garlic) |
Examples
Template Call | Result | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{EdibilityGrid|Melon|45}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Melon|45|showitem=true}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Parsnip|10}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Ginger|10}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Goat Cheese|50|hide=normal,silver}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Large Goat Milk JA|35|showitem=true}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Juice|30}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Wine|20}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Holly|-15}}
|
| ||||||||||||||||||||
{{EdibilityGrid|Bug Steak|18|quality=0}}
Missing health parameter; Shows incorrect health value |
| ||||||||||||||||||||
{{EdibilityGrid|Bug Steak|18|health=30|quality=0}}
|
|