Template:Condition: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Only close div if border exists)
m (Added border param to templatedata)
 
(36 intermediate revisions by 5 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 = name, icon, effects, CONCAT('{{{save|}}}') = save, CONCAT('{{{duration|}}}') = duration, CONCAT('{{{inline|}}}') = inline
| 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 = name = '{{#replace: {{{1}}} | ' | '' }}'
| where = _pageName = "{{#replace:{{{1}}}|&#39;|\'}} (Condition)"
| format = template
| format = template
| template = Condition/Format
| template = Condition/Format
Line 8: Line 8:
| order by = _ID
| order by = _ID
| more results text=
| more results text=
}}{{#if:{{{border|}}}|</div></div>||}}</onlyinclude></includeonly><noinclude>
| default = [[{{{1}}} (Condition)|{{{1}}}]]{{Main namespace only|[[Category:Pages with unknown conditions]]}}
Use this to display a condition.  Examples follow.
}}{{#if:{{{border|}}}|</div></div>||}}</onlyinclude></includeonly><noinclude>{{documentation|content=
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.
{{Template demo
| <nowiki>{{Condition | Bleeding | inline = true }}</nowiki>
| <nowiki>{{Cond|Bleeding}}</nowiki>
}}


<pre>
== See also ==
{{Condition | Bleeding }}
* {{t link|Condition/Format}} - An internal template actually responsible for formatting this template.
</pre>
* {{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.
Result:
----
{{Condition | Bleeding }}
----
 
=== With duration ===
 
Usage:
 
<pre>
{{Condition | Bleeding | duration = 2 }}
</pre>
 
Result:
----
{{Condition | Bleeding | duration = 2 }}
----
 
=== With saving throw ===
 
Usage:
 
<pre>
{{Condition | Bleeding | save = CON }}
</pre>
 
Result:
----
{{Condition | Bleeding | save = CON }}
----
 
=== With duration and saving throw ===
 
Usage:
 
<pre>
{{Condition | Bleeding | save = CON | duration = 2 }}
</pre>
 
Result:
----
{{Condition | Bleeding | save = CON | duration = 2 }}
----
 
=== With a border ===
 
Use {{InfoBlob|<nowiki>border = 1</nowiki>}} to add a border.
 
<pre>
{{Condition | Bleeding | save = CON | duration = 2 | border = 1}}
</pre>
 
Result:
----
{{Condition | Bleeding | save = CON | duration = 2 | border = 1}}
----
 
=== Inline-friendly ===
 
Usage:
<pre>
{{Condition | Bleeding | skip effect = true }}
</pre>
 
Result: blabla {{Condition | Bleeding | inline = true }} blabla


== Template parameters ==
<templatedata>
{
"description": "Display a block of information about a condition.",
    "format": "inline",
"params": {
"1": {
"description": "Name of the condition. This should match an entry in the conditions Cargo table.",
"required": true,
"label": "name",
"type": "string"
},
        "altname": {
"description": "An alternative display name for the condition link.",
"type": "string"
},
"duration": {
            "description": "Duration of the condition. This is generally a number of turns, but refer to Template:Duration for special values.",
            "type": "string",
            "suggestedvalues": ["Long rest", "Permanent", "Saving Throw", "Whilst on surface"],
            "example": "10"
        },
"save": {
            "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"],
            "example": "Strength"
        },
        "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.",
            "type": "string",
            "suggestedvalues": ["caster", "weapon action"],
            "example": "15"
        },
"radius m": {
            "description": "Radius of the condition in metres. This is rarely used.",
            "type": "number"
        },
        "border": {
"description": "Display a border around the condition box.",
"type": "boolean"
},
        "inline": {
"description": "Whether the condition should be formatted inline. See also Template:Condition inline.",
"type": "boolean",
            "deprecated": true
}
}
}
</templatedata>}}
[[Category: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