This template handles nourishment data for consumables.
{{User:BryghtShadow/nourishment
| type =
| duration =
| stack =
| name =
| icon =
| description =
}}
Parameters[edit]
- type
- "Food", "Utility".
- duration
- The duration of the effect either in seconds (without the unit) or the [#d][#h][#m][#s] format. Hidden if
0
, or an unsupported input.
- Only the highest time unit will be displayed:
1d2h3m4s
→ 1 d
3661
→ 1 h
- stack
- (optional) Specify if greater than 1.
- name
- (optional) Defaults to "Nourishment".
- icon
- (optional) Specify if different to default apple and spanner
- description
- The nourishment description.
Technical[edit]
- duration
- Duration should be provided as total seconds, or as suffixed times (e.g.
2h
, 1d 2h
, 1h 2d
).
- Due to the complexity of string parsing in template markup, the template will default to 0 seconds duration for unsupported suffixes such as
2mm
.
- Following the logic used in the game tooltips, any duration that is 0 will not be displayed.
Examples[edit]
- Support SMW so that information is not stored in multiple locations. — Easy enough, I think.
- Support effect ID — This should be feasible enough for most consumables that grant an effect. The effects have a chat link that can be searched for. However, some chat codes produces an empty message unless the effect is still in cache.
Downscaling[edit]
ID |
Effect
|
57601 |
|
Nourishment (1 h): Gain Health Every Second +20 Power +10% Karma +5% All Experience Gained +20% Magic Find +20% Gold Find +10% WXP Gained |
|