Template:Buffduration

From Terraria Wiki
Jump to navigation Jump to search
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:Buffduration/l10n for the localization of this template.
Important.svg
CAUTION: Terraria Wiki code is complex!!!
If you want to use this code on another wiki, wiki.gg staff are not able to assist you.
Please consider picking a different wiki to adapt code from, or making your own templates!
Remember that content on a wiki is more important than fancy formatting.
Template-info.svg Documentation The documentation below is transcluded from Template:Buffduration/doc. (edit | history)

This template displays a standardized sentence with the duration of a buff along with the methods to cancel the buff on the different game platforms.

Usage

{{ buffduration | <buff duration> | eversions = no/<page name> | nomaintext = y/yes }}

First unnamed parameter

Duration of the buff, preferably using the {{duration}} template. If omitted, the template will attempt to determine the buff duration automatically via {{iteminfo}}.

eversions

Disables the automatic exclusivity discovery if set to no. Otherwise, uses the specified page name (if set) as a base for the exclusivity discovery. See below for a detailed description.

nomaintext

Suppresses the display of the first part of the text. Therefore, the first unnamed parameter has no effect if this parameter is set.

Game platforms

The standard behavior of the template is to display information about how to cancel the buff on all different platforms. This is not always sensible, as some buffs are not available on all game platforms.

The template takes these steps to determine the proper game platforms for which the info should be displayed:

  1. Assume the buff is available on all platforms. Display the info for all platforms.
  2. If the page is a mainspace page with a corresponding Legacy page, then do not display the legacy platforms (as those belong on the Legacy counterpart page).
    Similarly, if the page is a Legacy page with a corresponding mainspace page, then do not display the modern platforms.
    • For example, the page Gills Potion has a corresponding Legacy page (Legacy:Gills Potion). Display only the modern platforms on the page Gills Potion and only the legacy platforms on the page Legacy:Gills Potion.
  3. Check if the buff item is exclusive to any platforms via {{eversions}}. If so, disregard the previous steps and display the info for the platforms reported by {{eversions}}.
    • For example, the Bewitching Table is exclusive to desktop/console/mobile. Only display the info for those platforms on that page.

These heuristics can be overridden manually:

  • |eversions=no disables the exclusivity check (step 3).
    • For example, the transclusion {{buffduration|eversions=no}} on the page Bewitching Table would display the info for all platforms (provided that no Legacy counterpart exists for the page – step 2).
  • |eversions=<entity> displays the info for the exact platforms that the specified entity is available on.
    • For example, the transclusion {{buffduration|eversions=Moon Lord}} on any page would display the info for desktop/console/mobile, i.e. exactly the platforms that the Moon Lord is available on.
  • Finally, each platform can forcibly be displayed or hidden via individual parameters (desktop=yes/no, console=yes/no, old-gen=yes/no, mobile=yes/no, 3ds=yes/no). This always takes precedence over everything else.

Examples

Code Result Notes
{{buffduration| {{duration|300}} }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version), by selecting the icon using Cycle Next/Previous Buff and then pressing Remove Buff (Console version), by selecting the icon and canceling it in the equipment menu (Old-gen console version), by double-tapping the buff icon (Mobile version), or by canceling the buff from the buffs screen (Nintendo 3DS version). Standard behavior. This page ("Buffduration") does not have any exclusivity information, so all platforms are displayed.
{{buffduration| {{duration|300}} | eversions = Moon Lord }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version), by selecting the icon using Cycle Next/Previous Buff and then pressing Remove Buff (Console version), or by double-tapping the buff icon (Mobile version). Specify a different page for exclusivity.
{{buffduration| {{duration|300}} | 3ds = no }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version), by selecting the icon using Cycle Next/Previous Buff and then pressing Remove Buff (Console version), by selecting the icon and canceling it in the equipment menu (Old-gen console version), or by double-tapping the buff icon (Mobile version). Remove the information about explicitly specified platforms.
{{buffduration| {{duration|300}} | console = no | mobile = no }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version), by selecting the icon and canceling it in the equipment menu (Old-gen console version), or by canceling the buff from the buffs screen (Nintendo 3DS version).
{{buffduration| {{duration|300}} | console = no | old-gen = no | 3ds = no }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version) or by double-tapping the buff icon (Mobile version).
{{buffduration| {{duration|300}} | desktop = no | console = no | old-gen = no | mobile = no }} This lasts for 5 minutes, but can be canceled at any time by canceling the buff from the buffs screen.
{{buffduration| {{duration|300}} | eversions = Moon Lord | mobile = no | 3ds = yes }} This lasts for 5 minutes, but can be canceled at any time by right-clicking the icon (Desktop version), by selecting the icon using Cycle Next/Previous Buff and then pressing Remove Buff (Console version), or by canceling the buff from the buffs screen (Nintendo 3DS version). Specify a page for exclusivity and modify the platforms manually.
Most buffs can be deactivated prematurely {{buffduration|nomaintext=y}}. Most buffs can be deactivated prematurely by right-clicking the icon (Desktop version), by selecting the icon using Cycle Next/Previous Buff and then pressing Remove Buff (Console version), by selecting the icon and canceling it in the equipment menu (Old-gen console version), by double-tapping the buff icon (Mobile version), or by canceling the buff from the buffs screen (Nintendo 3DS version). Use an entirely custom text.