Template:Condition: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
mNo edit summary
m (Added border param to templatedata)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><onlyinclude>{{#if:{{{border|}}}|<div style="padding-bottom: 1em"><div class="bg3wiki-tooltip-box">||}}{{#cargo_query: tables = conditions
<includeonly><onlyinclude>{{#if:{{{border|}}}|<div style="padding-bottom: 1em"><div class="bg3wiki-tooltip-box">||}}{{#cargo_query: tables = conditions
| fields = _pageName=page, name, icon, effects, types, CONCAT('{{{save|}}}') = save, CONCAT('{{{duration|}}}') = duration, CONCAT('{{{inline|}}}') = inline, CONCAT('{{#replace:{{{altname|}}}|'|\'}}') = altname, CONCAT('{{#replace:{{{dc|}}}|'|"}}') = dc, CONCAT('{{#if:{{{w|}}}|{{{w}}}|25}}') = w,
| fields = _pageName=page, name, icon, effects, types, CONCAT('{{{save|}}}') = save, CONCAT('{{{duration|}}}') = duration, CONCAT('{{{inline|}}}') = inline, CONCAT('{{#replace:{{{altname|}}}|'|\'}}') = altname, CONCAT('{{#replace:{{{radius m|}}}|'|\'}}') = radius m, CONCAT('{{#replace:{{{dc|}}}|'|"}}') = dc, CONCAT('{{#if:{{{w|}}}|{{{w}}}|25}}') = w,
| where = _pageName = "{{#replace:{{{1}}}|&#39;|\'}} (Condition)"
| where = _pageName = "{{#replace:{{{1}}}|&#39;|\'}} (Condition)"
| format = template
| format = template
Line 8: Line 8:
| order by = _ID
| order by = _ID
| more results text=
| more results text=
| default = [[{{{1}}} (Condition)|{{{1}}}]][[Category:Pages with unknown conditions]]
| default = [[{{{1}}} (Condition)|{{{1}}}]]{{Main namespace only|[[Category:Pages with unknown conditions]]}}
}}{{#if:{{{border|}}}|</div></div>||}}</onlyinclude></includeonly><noinclude>{{documentation|content=
}}{{#if:{{{border|}}}|</div></div>||}}</onlyinclude></includeonly><noinclude>{{documentation|content=
Use this to display a condition.  Examples follow.
Use this to display detailed information about a condition.


This template just runs the Cargo query. For the formatting, see: [[Template:Condition/Format]]
This template just runs the Cargo query. For the formatting, see: [[Template:Condition/Format]].


=== Base usage ===
== Examples ==
{{Template demo
| style = list
| <nowiki>{{Condition | Bleeding }}</nowiki>
| <nowiki>{{Condition | Bleeding | altname=oh no i'm bleeding | duration = 2 | save = CON }}</nowiki>
| <nowiki>
{{Condition
| Bleeding
| save = Constitution
| duration = 2
| dc = weapon action
| border = 1
}}</nowiki>
| <nowiki>{{Condition | Feverish | radius m = 3 | duration = Long rest}}</nowiki>
}}


Usage:
=== Inline example ===
 
This template can also be used inline, but refer to {{t link|Condition inline}} for a template designed for that.
<pre>
{{Template demo
{{Condition | Bleeding }}
| <nowiki>{{Condition | Bleeding | inline = true }}</nowiki>
</pre>
| <nowiki>{{Cond|Bleeding}}</nowiki>
}}


Result:
== See also ==
----
* {{t link|Condition/Format}} - An internal template actually responsible for formatting this template.
{{Condition | Bleeding }}
* {{t link|Condition inline}} - Similar template that just displays the icon of the condition. For use in inline text.
----
* {{t link|Condition page}} - Page generating template responsible for adding a condition into the condition Cargo table so that it can be referenced by this template.


=== With duration ===
== Template parameters ==
 
<templatedata>
Usage:
{
 
"description": "Display a block of information about a condition.",
<pre>
    "format": "inline",
{{Condition | Bleeding | duration = 2 }}
"params": {
</pre>
"1": {
 
"description": "Name of the condition. This should match an entry in the conditions Cargo table.",
Result:
"required": true,
----
"label": "name",
{{Condition | Bleeding | duration = 2 }}
"type": "string"
----
},
 
        "altname": {
=== With saving throw ===
"description": "An alternative display name for the condition link.",
 
"type": "string"
Usage:
},
 
"duration": {
<pre>
            "description": "Duration of the condition. This is generally a number of turns, but refer to Template:Duration for special values.",
{{Condition | Bleeding | save = CON }}
            "type": "string",
</pre>
            "suggestedvalues": ["Long rest", "Permanent", "Saving Throw", "Whilst on surface"],
 
            "example": "10"
Result:
        },
----
"save": {
{{Condition | Bleeding | save = CON }}
            "description": "Ability used for the saving throw to resist this condition. Accepts abilities in either the shorthand (e.g. STR) or long form (e.g. Strength)",
----
            "type": "string",
 
            "suggestedvalues": ["STR", "DEX", "CON", "INT", "WIS", "CHA"],
=== With duration and saving throw ===
            "example": "Strength"
 
        },
Usage:
        "dc": {
 
            "description": "The difficulty class of the saving throw to resist this condition. This is either a fixed number or a special value like \"caster\". Refer to Template:Saving Throw for these special values.",
<pre>
            "type": "string",
{{Condition | Bleeding | save = CON | duration = 2 | dc = 15 }}
            "suggestedvalues": ["caster", "weapon action"],
</pre>
            "example": "15"
 
        },
Result:
"radius m": {
----
            "description": "Radius of the condition in metres. This is rarely used.",
{{Condition | Bleeding | save = CON | duration = 2 | dc = 15 }}
            "type": "number"
----
        },
 
        "border": {
=== With a border ===
"description": "Display a border around the condition box.",
 
"type": "boolean"
Use {{InfoBlob|<nowiki>border = 1</nowiki>}} to add a border.
},
 
        "inline": {
<pre>
"description": "Whether the condition should be formatted inline. See also Template:Condition inline.",
{{Condition | Bleeding | save = CON | duration = 2 | border = 1}}
"type": "boolean",
</pre>
            "deprecated": true
 
}
Result:
}
----
}
{{Condition | Bleeding | save = CON | duration = 2 | border = 1}}
</templatedata>}}
----
[[Category:Templates]]
 
=== Inline-friendly ===
 
Usage:
<pre>
{{Condition | Bleeding | inline = true }}
</pre>
 
Result: blabla {{Condition | Bleeding | inline = true }} blabla
 
=== Alternative display name ===
<pre>
{{Condition | Bleeding | save = CON | altname=oh no i'm bleeding | duration = 2 }}
</pre>
 
Result:
{{Condition | Bleeding | save = CON | altname=oh no i'm bleeding | duration = 2 }}
 
== Also displays types ==
{{Condition | Feverish }}
}}
[[Category:Condition templates]]
[[Category:Condition templates]]
</noinclude>
</noinclude>

Latest revision as of 23:26, 21 July 2024

Template documentation

Use this to display detailed information about a condition.

This template just runs the Cargo query. For the formatting, see: Template:Condition/Format.

Examples

Markup
{{Condition | Bleeding }}
Renders as
Bleeding Bleeding
Markup
{{Condition | Bleeding | altname=oh no i'm bleeding | duration = 2 | save = CON }}
Renders as
oh no i'm bleeding oh no i'm bleeding

Duration: 2 turns

Constitution saving throw

Markup
{{Condition
| Bleeding 
| save = Constitution 
| duration = 2 
| dc = weapon action
| border = 1
}}
Renders as
Bleeding Bleeding

Duration: 2 turns

Weapon action DC  Constitution saving throw

Markup
{{Condition | Feverish | radius m = 3 | duration = Long rest}}
Renders as
Feverish Feverish

Duration: Until Long rest

Radius: 3 m / 10 ft

Inline example

This template can also be used inline, but refer to {{Condition inline}} for a template designed for that.

Markup Renders as
{{Condition | Bleeding | inline = true }}
Bleeding Bleeding
{{Cond|Bleeding}}
Bleeding Bleeding

See also

  • {{Condition/Format}} - An internal template actually responsible for formatting this template.
  • {{Condition inline}} - Similar template that just displays the icon of the condition. For use in inline text.
  • {{Condition page}} - Page generating template responsible for adding a condition into the condition Cargo table so that it can be referenced by this template.

Template parameters

Display a block of information about a condition.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
name1

Name of the condition. This should match an entry in the conditions Cargo table.

Stringrequired
altnamealtname

An alternative display name for the condition link.

Stringoptional
durationduration

Duration of the condition. This is generally a number of turns, but refer to Template:Duration for special values.

Suggested values
Long rest Permanent Saving Throw Whilst on surface
Example
10
Stringoptional
savesave

Ability used for the saving throw to resist this condition. Accepts abilities in either the shorthand (e.g. STR) or long form (e.g. Strength)

Suggested values
STR DEX CON INT WIS CHA
Example
Strength
Stringoptional
dcdc

The difficulty class of the saving throw to resist this condition. This is either a fixed number or a special value like "caster". Refer to Template:Saving Throw for these special values.

Suggested values
caster weapon action
Example
15
Stringoptional
radius mradius m

Radius of the condition in metres. This is rarely used.

Numberoptional
borderborder

Display a border around the condition box.

Booleanoptional
inlineinline

Whether the condition should be formatted inline. See also Template:Condition inline.

Booleandeprecated