Ad placeholder

Template:Duration: Difference between revisions

Jump to navigation Jump to search
Updated documentation and added more robust case-insensitive handling of special durations
(add drop shadow in light mode)
(Updated documentation and added more robust case-insensitive handling of special durations)
 
Line 1: Line 1:
<includeonly>{{SmallIcon|Duration Icons.png|class=bg3wiki-lightmode-drop-shadow}} Duration: {{#switch:{{{1}}}
<includeonly>{{SmallIcon|Duration Icons.png|class=bg3wiki-lightmode-drop-shadow}} Duration: {{#switch:{{lc:{{{1}}}}}
| 1 = 1 turn
| 1 = 1 turn
| permanent
| permanent = Permanent
| Permanent = Permanent
| short rest
| short rest
| Short rest
| until short rest = Until [[short rest]]
| Short Rest
| until short rest
| Until Short rest
| Until Short Rest = Until [[short rest]]
| long rest
| long rest
| Long rest
| until long rest = Until [[Long rest]]
| Long Rest
| until long rest
| Until Long rest
| Until Long Rest = Until [[Long rest]]
| saving throw
| saving throw
| Saving throw
| until saving throw = Until successful [[Saving Throw]]
| Saving Throw
| until saving throw
| Until Saving throw
| Until Saving Throw = Until successful [[Saving Throw]]
| surface
| surface
| Surface
| whilst on surface = Whilst on surface
| whilst on surface
| Whilst on surface = Whilst on surface
| #default = {{{1}}} turns
| #default = {{{1}}} turns
}}</includeonly><noinclude>
}}</includeonly><noinclude>{{documentation|content=
Provide a number (in turns) and display that duration.
__NOTOC__
Display a nicely formatted duration.


== Usage Examples ==
The duration can be a number of turns or one of the special values below:
=== Number of Turns ===
* {{c|Permanent}}
Usage:
* {{c|Until short rest}} or {{c|Short rest}}
<pre>{{Duration|1}}</pre>
* {{c|Until long rest}} or {{c|Long rest}}
* {{c|Until saving throw}} or {{c|Saving throw}}
* {{c|Surface}} or {{c|Whilst on surface}}
These special values are not case sensitive.


Result:
== Examples ==
{{Duration|1}}
{{Template demo
----
| <nowiki>{{Duration|1}}</nowiki>
Usage:
| <nowiki>{{Duration|5}}</nowiki>
<pre>{{Duration|3}}</pre>
| <nowiki>{{Duration|Until Long Rest}}</nowiki>
| <nowiki>{{Duration|PERMANENT}}</nowiki>
| <nowiki>{{Duration|Whilst on surface}}</nowiki>
| <nowiki>{{Duration|Saving Throw}}</nowiki>
}}


Result:
== Template data ==
{{Duration|3}}
<templatedata>
{
    "description": "Display a nicely formatted duration",
    "format": "inline",
"params": {
"1": {
"description": "Duration specified as a number of turns or one of the special values below.",
            "suggestedvalues": ["Permanent", "Short rest", "Until short rest", "Long rest", "Until long rest", "Saving throw", "Until saving throw", "Surface", "Whilst on surface"],
"required": true,
"label": "duration",
"type": "string"
}
}
}
</templatedata>}}


=== Alternative Usage: Until Long Rest ===
</noinclude>
Alternative usage for '''Until Long Rest''' duration:
<pre>{{Duration|Until Long Rest}}</pre>
 
Result:
{{Duration|Until Long Rest}}
 
=== Alternative Usage: Permanent ===
Alternative usage for '''Permanent''' duration:
<pre>{{Duration|Permanent}}</pre>
 
Result:
{{Duration|Permanent}}
 
=== Alternative Usage: Whilst on surface ===
Alternative usage for '''Whilst on surface''' duration:
<pre>{{Duration|Whilst on surface}}</pre>
 
Result:
{{Duration|Whilst on surface}}
 
=== Alternative Usage: Until Saving Throw ===
Alternative usage for '''Until Saving Throw''' duration:
<pre>{{Duration|Saving Throw}}</pre>
 
Result:
{{Duration|Saving Throw}}
__NOTOC__</noinclude>

Navigation menu