7,230
editsAd 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 | ||
| short rest | | short rest | ||
| until short rest = Until [[short rest]] | |||
| until short rest | |||
| long rest | | long rest | ||
| until long rest = Until [[Long rest]] | |||
| until long rest | |||
| saving throw | | saving throw | ||
| until saving throw = Until successful [[Saving Throw]] | |||
| until saving throw | |||
| surface | | surface | ||
| whilst on surface = Whilst on surface | |||
| whilst | |||
| #default = {{{1}}} turns | | #default = {{{1}}} turns | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude>{{documentation|content= | ||
__NOTOC__ | |||
Display a nicely formatted duration. | |||
The duration can be a number of turns or one of the special values below: | |||
* {{c|Permanent}} | |||
* {{c|Until short rest}} or {{c|Short rest}} | |||
* {{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. | |||
== Examples == | |||
{{Duration|1}} | {{Template demo | ||
| <nowiki>{{Duration|1}}</nowiki> | |||
| <nowiki>{{Duration|5}}</nowiki> | |||
< | | <nowiki>{{Duration|Until Long Rest}}</nowiki> | ||
| <nowiki>{{Duration|PERMANENT}}</nowiki> | |||
| <nowiki>{{Duration|Whilst on surface}}</nowiki> | |||
| <nowiki>{{Duration|Saving Throw}}</nowiki> | |||
}} | |||
== Template data == | |||
{{Duration | <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>}} | |||
</noinclude> | |||