模板:Hp

来自Terraria Wiki
跳到导航 跳到搜索
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Hp/l10n for the localization of this template.
Template-info.svg 文档 以下文档来自Template:Hp/doc。(编辑 | 历史

A template that displays health values in a similar fashion to Terraria.

Usage

{{ hp | <health value> | small = 1 (optional) | link = 1 (optional) }}

参数描述类型状态
Health value1
Health value to display.
示例:
150
数字
必填
Compressedsmall
Reduces the display to a compact format, useful when space is an issue.
自动值:
True (1/y/yes)
布尔值
可选

此模板首选参数行内格式。

Examples

  • {{hp|100}} returns
    PlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
  • {{hp|100|small=1}} returns
    Heart.png × 5
  • {{hp|460}} returns
PlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
  • {{hp|460|small=1}} returns
    Heart.png × 20 + Life Fruit.png × 12

Notes

  • The standard form of the template cannot round values and does not account for the Lifeforce Potion. Between 0 and 400, use increments of 20. Between 400 and 500, increments of 5.
    • The small parameter will allow rounded values, but rounds down regardless of value, i.e, {{hp|119|small=1}} returns
      Heart.png × 5
  • By default, the template's output is provided with a hover text, displaying the health value that was used as the input. Use the parameter link=1 to suppress this hover text and make the icons clickable:
{{hp|100|link=1}} returns
PlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
{{hp|460|small=1|link=1}} returns
Heart.png × 20 + Life Fruit.png × 12