Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Condition page: Difference between revisions

Template page
Rearranged the section layout so that condition sources is above the table of conditions with the same stack ID. The stack ID table can get very long which obscured the more pertinent information about the condition sources.
 
(89 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<includeonly><div class="bg3wiki-tooltip-box"><!--Extract name and icon from the page title-->{{#lvardef: name
<includeonly>__NOTOC__<div class="bg3wiki-tooltip-box"><!--Extract name and icon from the page title-->{{#lvardef: name
| {{{name | {{#explode: {{#titleparts: {{PAGENAME}} }} | ( | 0 }} }}}
| {{{name | {{#explode: {{#titleparts: {{PAGENAME}} }} | ( | 0 }} }}}
}}{{#lvardef: page
| {{#explode: {{#titleparts: {{PAGENAME}} }} | (Condition) | 0 }}
}}{{#lvardef: icon
}}{{#lvardef: icon
| {{{icon | {{#replace: {{#lvar:name}} | : | }} Condition Icon.webp }}}
| {{{icon | {{#replace: {{#lvar:name}} | : | }} Condition Icon.webp }}}
}}{{#lvardef: type
}}{{#lvardef: type
<!--backwards compat for disease-->
<!--backwards compat for disease-->
| {{#ifeq:{{{disease|}}}|yes|disease}}{{#if:{{{type|}}}|{{{type}}} }}
| {{#ifeq:{{{disease|}}}|yes|disease|{{{type|}}} }}
}}<!-- Check if the stack ID is used by any other conditions and save it as #lvar:stackid --> {{#if:{{{stack id|}}}|{{#vardefine:counter|0
}}{{#cargo_query:tables=conditions|fields=name|where=stack_id='{{{stack id}}}'||order by=name ASC|format=template|template=counter|default=
}}{{#lvardef:stackid|{{#ifeq:{{#var:counter}}|1||1}}}}
}}<!-- Status properties --> {{#lvardef:FreezeDuration|{{#if:{{#invoke:String2|matchAny|source={{{properties}}}|FreezeDuration}}|1|}}
 
}}{{PageSeo
| title = {{PAGENAME}}
| image = {{#lvar:icon}}
| description = {{{effects|}}}
}}<!--Actual display starts here-->{{NoExcerpt | {{icon| {{#lvar:icon}} |30}} '''{{#lvar:name}}''' }}
}}<!--Actual display starts here-->{{NoExcerpt | {{icon| {{#lvar:icon}} |30}} '''{{#lvar:name}}''' }}


{{{effects|}}} {{#if: {{#lvar:type}} | {{blank}}
{{{effects|}}} {{#if: {{{warning|}}} | <br>
* {{Condition/Type|{{#lvar:type}} }}
<p>{{Colour|white|{{{warning}}}}}</p> }}{{#if: {{#lvar:type}} | <br>
}}</div><!--some housekeeping:categories and cargo-->{{#switch: {{{this is an example|}}}
{{Condition type|{{#lvar:type}} }}}}{{#if:{{{honour mode|}}}|{{blank}}
| yes =
 
| #default = [[Category:Conditions]]
== Honour mode ==
}}{{#switch: {{{this is an example|}}}
{{{honour mode}}}}}{{#if:{{#lvar:stackid}}{{{status groups|}}}{{{tick type|}}}{{{stack type|}}}{{{properties|}}}|{{blank}}
| yes =
 
| #default = {{#cargo_store: _table = conditions
== Properties ==
| name = {{#lvar:name}}
{{#if:{{#lvar:stackid}}|{{blank}}
| icon = {{#lvar:icon}}
 
| type = {{#lvar:type}}
{{SmIconLink|Info Icon.png|Stack ID}}: {{code|{{{stack id}}}}}{{Main namespace only|[[Category:Has stack ID]]}}|{{Main namespace only|[[Category:No stack ID]]}}
}}
}}{{#if: {{{status groups|}}}|{{blank}}
}}</includeonly><noinclude>
{{#arraydefine:status groups|{{{status groups|}}}|,}}
If the page title is {{C|Blah (Condition)}}, then you don't have to provide the {{C|name}} parameter.  Likewise, if the icon for the condition is called {{C|Blah Condition Icon.webp}} then you don't have to provide the {{C|icon}} parameter.
{{SmIconLink|Plus Icon.png|Status groups}}: {{#arrayprint:status groups|,&nbsp;|@|{{SG|@}}}}{{Main namespace only|[[Category:Has status groups]]}}|{{Main namespace only|[[Category:No status groups]]}}
}}{{#if: {{{tick type|}}}{{#lvar:FreezeDuration}}|{{blank}}
 
{{SmIconLink|Duration Icons.png|Conditions#Duration|Loses duration}}: {{#if:{{#lvar:FreezeDuration}}|{{SP|FreezeDuration|No}}|{{#switch: {{lc:{{{tick type}}}}}
| start | start turn | startturn = start of turn
| end | end turn | endturn = end of turn
| start round | startround = start of round
| end round | endround = end of round
| none = N/A
| #default = !syntax error!
}}}}{{Main namespace only|[[Category:Has tick type]]}}|{{Main namespace only|[[Category:No tick type]]}}}}{{#if: {{{stack type|}}}|{{blank}}
 
{{SmIconLink|Sort Icon.png|Conditions#Stack type|If already applied}}: {{#switch: {{lc:{{{stack type}}}}}
| additive = add to duration
| overwrite = replace current
| ignore = don't apply
| none = N/A
| #default = !syntax error!
}}{{Main namespace only|[[Category:Has stack type]]}}|{{Main namespace only|[[Category:No stack type]]}}
}}{{#if: {{{stack priority|}}}|{{blank}}
 
{{SmIconLink|Empty Icon.png|Stack priority}}: {{{stack priority}}}{{Main namespace only|[[Category:Has stack priority]]}}|{{Main namespace only|[[Category:No stack priority]]}}
}}{{#if: {{{properties|}}}|{{blank}}
 
{{SmIconLink|Options Icon.png|Status properties|More properties}}:{{#invoke:ParseList|main|{{#arraydefine:propertiesList|{{{properties|}}}|,}}{{#arrayprint:propertiesList|,|@|{{SP|@}}}}|type=htmlList}}{{Main namespace only|[[Category:Has status properties]]}}|{{Main namespace only|[[Category:No status properties]]}}}}|{{Main namespace only|[[Category:No stack ID]][[Category:No status groups]][[Category:No tick type]][[Category:No stack type]][[Category:No stack priority]][[Category:No status properties]]}}
|{{Main namespace only|[[Category:Condition pages with no properties]]}}}}
</div> {{#if: {{{grants|}}} |
 
<h2> Grants: </h2>
 
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
{{#invoke: ParseList | main | {{{grants}}} | type = htmlListNoBullets | useTemplate = SAI/fixed }}
</div>
 
}}{{#if: {{{condition|}}} |
 
<h2> Condition: {{{condition}}} </h2>


<pre>
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
{{ConditionPage
{{Condition | {{{condition}}}
| effects =
| save = {{{condition save|}}}
| type =
| dc = {{{condition dc|}}}
| radius m = {{{condition radius m|}}}
| duration = {{{condition duration|}}}
}}
}}
</pre>
{{main namespace only|{{Inflicts|{{{condition}}}|cond|type=condition|dc={{{condition dc|}}}|save={{{condition save|}}}|duration={{{condition duration|}}}}}}}
</div>


Examples:
}}{{#if: {{{condition2|}}} | {{blank}}


= Blade Ward (Condition) =
<h2> Condition: {{{condition2}}} </h2>


{{ConditionPage
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
| name = Blade Ward
{{Condition | {{{condition2}}}
| effects =
| save = {{{condition2 save|}}}
* Has [[resistance]] against {{DamageType|Bludgeoning}}, {{DamageType|Piercing}}, and {{DamageType|Slashing}} damage dealt by weapon attacks. Damage of these types is halved.
| dc = {{{condition2 dc|}}}
| this is an example = yes
| radius m = {{{condition2 radius m|}}}
| duration = {{{condition2 duration|}}}
}}
}}
{{main namespace only|{{Inflicts|{{{condition2}}}|cond|type=condition|dc={{{condition2 dc|}}}|save={{{condition2 save|}}}|duration={{{condition2 duration|}}}}}}}
</div>
}}{{#if: {{{condition3|}}} | {{blank}}


= Bone Chilled (Condition) =
<h2> Condition: {{{condition3}}} </h2>


{{ConditionPage
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
| name = Bone Chilled
{{Condition | {{{condition3}}}
| effects =  
| save = {{{condition3 save|}}}
* Can not regain [[Hit Points]].
| dc = {{{condition3 dc|}}}
* If Undead, has {{Disadvantage}} on [[Attack Roll]]s.
| radius m = {{{condition3 radius m|}}}
| this is an example = yes
| duration = {{{condition3 duration|}}}
}}
}}
{{main namespace only|{{Inflicts|{{{condition3}}}|cond|type=condition|dc={{{condition3 dc|}}}|save={{{condition3 save|}}}|duration={{{condition3 duration|}}}}}}}
</div>
}}<references/>
{{#if:{{{notes|}}}|
== Notes ==
{{{notes}}}
}}
{{#if:{{{bugs|}}}|
== Bugs ==
{{{bugs}}}
[[Category:Bugs]]
}}{{#if: {{{suppress sources|}}} | | {{blank}}


= Flesh Rot (Condition) =
== Sources of {{#lvar:name}} ==


{{ConditionPage
{{Condition sources | {{#lvar:page}} }}
| name = Flesh Rot
| effects =
* Flesh is decaying.
* {{Disadvantage}} on [[Ability Check]]s and {{SavingThrow}}s using Charisma.
* Vulnerable to all damage.
| type = disease
| this is an example = yes
}}
}}
<!--some housekeeping:categories and cargo-->{{Main namespace only|[[Category:Conditions]]{{#cargo_store: _table = conditions
| name = {{#lvar:name}}
| icon = {{#lvar:icon}}
| brief = {{{brief|}}}
| types = {{#lvar:type}}
| condition_name = {{{condition|}}}
| condition2_name = {{{condition2|}}}
| condition3_name = {{{condition3|}}}
}}{{#if:{{#lvar:stackid}}|{{blank}}


[[Category:Page generating templates]]
== Conditions with the same stack ID ==
 
Conditions with the [[stack ID]] {{code|{{{stack id}}}}}, only one of these can be applied at the same time:
{{#cargo_declare: _table = conditions
{{#cargo_query:
tables = conditions
|fields = _pageName = page, name, icon, effects
|where = stack_id='{{{stack id}}}'
|order by = name
|format=template
|named args = yes
|template=ConditionsTableRow
|intro={{ConditionsTableHeader}}
|outro={{ConditionsTableFooter}}
}}{{Main namespace only|[[Category:Conditions with shared stack IDs]]}}
}}
}}</includeonly><noinclude>{{documentation}}{{#cargo_declare: _table = conditions
| name = String (unique, mandatory)
| name = String (unique, mandatory)
| icon = File
| icon = File
| effects = Wikitext
| effects = Wikitext
| type = String(disease, curse, poison)
| brief = Wikitext
| types = List (,) of String
| stack_id = string
| status_groups = List (,) of String
| tick_type = String
| properties = List (,) of String
| stack_type = String
| condition_name = String
| condition_save = String
| condition_dc = String
| condition2_name = String
| condition2_save = String
| condition2_dc = String
| condition3_name = String
| condition3_save = String
| condition3_dc = String
}}
}}
[[Category:Templates]]
[[Category:Condition templates]]
[[Category:Page generating templates]]
[[Category:Cargo templates]]
</noinclude>
</noinclude>