Template:Condition page: Difference between revisions

Jump to navigation Jump to search
Order stack id conditions by name
(Added support for warning)
(Order stack id conditions by name)
(47 intermediate revisions by 5 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 }}}
Line 6: Line 8:
<!--backwards compat for disease-->
<!--backwards compat for disease-->
| {{#ifeq:{{{disease|}}}|yes|disease|{{{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
}}{{PageSeo
| title = {{PAGENAME}}
| title = {{PAGENAME}}
Line 12: Line 21:
}}<!--Actual display starts here-->{{NoExcerpt | {{icon| {{#lvar:icon}} |30}} '''{{#lvar:name}}''' }}
}}<!--Actual display starts here-->{{NoExcerpt | {{icon| {{#lvar:icon}} |30}} '''{{#lvar:name}}''' }}


{{{effects|}}} {{#if: {{{warning|}}} |
{{{effects|}}} {{#if: {{{warning|}}} | <br>
<p>{{Colour|white|{{{warning}}}}}</p> }}{{#if: {{#lvar:type}} | <br>
<p>{{Colour|white|{{{warning}}}}}</p> }}{{#if: {{#lvar:type}} | <br>
{{Condition type|{{#lvar:type}} }}
{{Condition type|{{#lvar:type}} }}}}{{#if:{{{honour mode|}}}|{{blank}}
}}</div><references/>
 
{{#if:{{{honour mode|}}}|
== [[Honour mode]] ==
== [[Honour mode]] ==
{{{honour mode}}}
{{{honour mode}}}}}{{#if:{{#lvar:stackid}}{{{status groups|}}}{{{tick type|}}}{{{stack type|}}}{{{properties|}}}|{{blank}}
}}
 
{{#if:{{{notes|}}}|
== Properties ==
== Notes ==
{{#if:{{#lvar:stackid}}|{{blank}}
{{{notes}}}
 
}}
{{SmallIcon|Info Icon.png|link=Status ID}}[[Stack ID]]: {{code|{{{stack id}}}}}{{Main namespace only|[[Category:Has stack ID]]}}|{{Main namespace only|[[Category:No stack ID]]}}
{{#if:{{{suppress sources|}}}||
}}{{#if: {{{status groups|}}}|{{blank}}
== Sources of {{#lvar:name}} ==
{{#arraydefine:status groups|{{{status groups|}}}|,}}
{{Condition sources|{{#lvar:name}}}}
{{SmallIcon|Plus Icon.png|link=Status groups}}[[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}}
<!--some housekeeping:categories and cargo-->{{Main namespace only|[[Category:Conditions]]}}{{#switch: {{{this is an example|}}}
 
| yes =
{{SmallIcon|Duration Icons.png}}[[Conditions#Duration|Loses duration]]: {{#if:{{#lvar:FreezeDuration}}|{{SP|FreezeDuration|No}}|{{#switch: {{lc:{{{tick type}}}}}
| #default = {{#cargo_store: _table = conditions
| start | start turn | startturn = start of turn
| name = {{#lvar:name}}
| end | end turn | endturn = end of turn
| icon = {{#lvar:icon}}
| start round | startround = start of round
| types = {{#lvar:type}}
| end round | endround = end of round
}}
| none = N/A
}}</includeonly><noinclude>{{documentation|content=
| #default = !syntax error!
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.
}}}}{{Main namespace only|[[Category:Has tick type]]}}|{{Main namespace only|[[Category:No tick type]]}}}}{{#if: {{{stack type|}}}|{{blank}}
 
{{SmallIcon|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}}


If a condition has multiple types, separate them with a semicolon.
{{SmallIcon|Empty Icon.png}}[[Stack priority]]: {{{stack priority}}}{{Main namespace only|[[Category:Has stack priority]]}}|{{Main namespace only|[[Category:No stack priority]]}}
}}{{#if: {{{properties|}}}|{{blank}}


<pre>
{{SmallIcon|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]]}}}}
{{Condition Page
</div> {{#if: {{{grants|}}} |
| effects =
| type =
| honour mode =
| notes =
}}
</pre>


Examples:
<h2> Grants: </h2>


== Blade Ward (Condition) ==
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
{{#invoke: ParseList | main | {{{grants}}} | type = htmlListNoBullets | useTemplate = SAI/fixed }}
</div>


{{ConditionPage
}}{{#if: {{{condition|}}} |
| name = Blade Ward
| effects =
* Has [[resistance]] against {{DamageType|Bludgeoning}}, {{DamageType|Piercing}}, and {{DamageType|Slashing}} damage dealt by weapon attacks. Damage of these types is halved.
| this is an example = yes
| notes = * note 1
* note 2
}}


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


{{ConditionPage
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
| name = Bone Chilled
{{Condition | {{{condition}}}
| effects =  
| save = {{{condition save|}}}
* Can not regain [[Hit Points]].
| dc = {{{condition dc|}}}
* If Undead, has {{Disadvantage}} on [[Attack Roll]]s.
| duration = {{{condition duration|}}}
| this is an example = yes
}}
}}
{{main namespace only|{{Inflicts|{{{condition}}}|cond}}}}
</div>


== Flesh Rot (Condition) ==
}}{{#if: {{{condition2|}}} | {{blank}}


{{ConditionPage
<h2> Condition: {{{condition2}}} </h2>
| name = Flesh Rot
 
| effects =
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
* Flesh is decaying.
{{Condition | {{{condition2}}}
* {{Disadvantage}} on [[Ability Check]]s and {{SavingThrow}}s using Charisma.
| save = {{{condition2 save|}}}
* Vulnerable to all damage.
| dc = {{{condition2 dc|}}}
| type = diseased
| duration = {{{condition2 duration|}}}
| this is an example = yes
}}
}}
{{main namespace only|{{Inflicts|{{{condition2}}}|cond}}}}
</div>


== Multiple types example ==
}}{{#if: {{{condition3|}}} | {{blank}}


{{ConditionPage
<h2> Condition: {{{condition3}}} </h2>
| name = Absolutely Ruined
 
| icon = Generic Death Icon.webp
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
| effects =  
{{Condition | {{{condition3}}}
* How are you still alive?
| save = {{{condition3 save|}}}
* {{Disadvantage}} on [[Ability Check]]s and {{SavingThrow}}s using Charisma.
| dc = {{{condition3 dc|}}}
* Vulnerable to all damage.
| duration = {{{condition3 duration|}}}
| type = diseased, cursed,incapacitated, prone, charmed
}}
| this is an example = yes
{{main namespace only|{{Inflicts|{{{condition3}}}|passive}}}}
| suppress sources = true
</div>
}}<references/>
{{#if:{{{notes|}}}|
== Notes ==
{{{notes}}}
}}
}}
{{#if:{{{bugs|}}}|
== Bugs ==
{{{bugs}}}
[[Category:Bugs]]
}}{{#if:{{#lvar:stackid}}|{{blank}}
== 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_query:
tables = conditions
|fields = 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]]}}
}}{{#if: {{{suppress sources|}}} | | {{blank}}


[[Category:Page generating templates]][[Category:Condition templates]]
== Sources of {{#lvar:name}} ==


{{#cargo_declare: _table = conditions
{{Condition sources | {{#lvar:page}} }}
}}
<!--some housekeeping:categories and cargo-->{{Main namespace only|[[Category:Conditions]]{{#cargo_store: _table = conditions
| name = {{#lvar:name}}
| icon = {{#lvar:icon}}
| brief = {{{brief | {{{effects|}}} }}}
| types = {{#lvar:type}}
}}
}}</includeonly><noinclude>{{documentation}}{{#cargo_declare: _table = conditions
| name = String (unique, mandatory)
| name = String (unique, mandatory)
| icon = File
| icon = File
| effects = Wikitext
| effects = Wikitext
| brief = Wikitext
| types = List (,) of String
| types = List (,) of String
}}
| stack_id = string
 
| status_groups = List (,) of String
== Template data ==
| tick_type = String
<templatedata>
| properties = List (,) of String
{
| stack_type = String
"params": {
}}</noinclude>
"name": {
"description": "If specified, overrides the name.",
"type": "string",
"default": "Uses the name of the page, minus (Condition)."
},
"icon": {
"description": "If specified, overrides the icon.",
"type": "wiki-file-name",
"default": "Uses the \"name\" plus Condition.webp"
},
"disease": {
"description": "If specified, sets the type to be disease",
"type": "boolean",
"deprecated": true
},
"type": {
"description": "The type or types of the condition. If multiple, separate the types with commas.",
"type": "string"
},
"effects": {
"description": "The description of the condition.",
"type": "content",
"suggested": true
},
"this is an example": {
"description": "If specified, does not insert into the Conditions table.",
"type": "boolean"
},
"suppress sources": {
"description": "If specified, will not display \"sources of\".",
"type": "boolean"
},
"honour mode": {
"description": "Changes that apply under the honour mode difficulty.",
"type": "string"
},
"notes": {
"description": "Notes, displayed before the list of sources",
"type": "string"
}
}
}
</templatedata>}}</noinclude>

Navigation menu