Template:Condition page: Difference between revisions

Jump to navigation Jump to search
Order stack id conditions by name
(Moved honour mode changes to inside box. Added support and documentation for Stack ID, Status groups, Tick type, Stack type and Status properties, under new "Properties" section.)
(Order stack id conditions by name)
(44 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 17: Line 26:


== [[Honour mode]] ==
== [[Honour mode]] ==
{{{honour mode}}}}}{{#if:{{{status groups|}}}{{{tick type|}}}{{{stack type|}}}|{{blank}}
{{{honour mode}}}}}{{#if:{{#lvar:stackid}}{{{status groups|}}}{{{tick type|}}}{{{stack type|}}}{{{properties|}}}|{{blank}}


== Properties ==
== Properties ==
{{#if: {{{stack id|}}}|{{blank}}
{{#if:{{#lvar:stackid}}|{{blank}}


{{SmallIcon|Info Icon.png|link=Status ID}}[[Stack ID]]: {{code|{{{stack id}}}}}}}{{#if: {{{status groups|}}}|{{blank}}
{{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: {{{status groups|}}}|{{blank}}
{{#arraydefine:status groups|{{{status groups|}}}|,}}
{{#arraydefine:status groups|{{{status groups|}}}|,}}
{{SmallIcon|Plus Icon.png|link=Status groups}}[[Status groups]]: {{#arrayprint:status groups|,&nbsp;|@|{{SG|@}}}}}}
{{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|}}}|{{blank}}
}}{{#if: {{{tick type|}}}{{#lvar:FreezeDuration}}|{{blank}}


{{SmallIcon|Duration Icons.png}}[[Conditions#Duration|Lose duration]]: {{#switch: {{{tick type}}}
{{SmallIcon|Duration Icons.png}}[[Conditions#Duration|Loses duration]]: {{#if:{{#lvar:FreezeDuration}}|{{SP|FreezeDuration|No}}|{{#switch: {{lc:{{{tick type}}}}}
  | start = start of turn
  | start | start turn | startturn = start of turn
  | end = end of turn
  | end | end turn | endturn = end of turn
| start round | startround = start of round
| end round | endround = end of round
  | none = N/A
  | none = N/A
  | #default = !syntax error!
  | #default = !syntax error!
}}}}{{#if: {{{stack type|}}}|{{blank}}
}}}}{{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: {{{stack type}}}
{{SmallIcon|Sort Icon.png}}[[Conditions#Stack type|If already applied]]: {{#switch: {{lc:{{{stack type}}}}}
  | additive = add to duration
  | additive = add to duration
  | overwrite = replace current
  | overwrite = replace current
Line 40: Line 52:
  | none = N/A
  | none = N/A
  | #default = !syntax error!
  | #default = !syntax error!
}}}}{{#if: {{{properties|}}}|{{blank}}
}}{{Main namespace only|[[Category:Has stack type]]}}|{{Main namespace only|[[Category:No stack type]]}}
}}{{#if: {{{stack priority|}}}|{{blank}}
 
{{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}}


{{SmallIcon|Options Icon.png}}[[Status properties|More properties]]:{{#invoke:ParseList|main|{{#arraydefine:propertiesList|{{{properties|}}}|,}}{{#arrayprint:propertiesList|,|@|[[Status properties/@|@]]}}|type=htmlList}}}}}}
{{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]]}}}}
</div><references/>
</div> {{#if: {{{grants|}}} |
{{#if:{{{notes|}}}|
== Notes ==
{{{notes}}}
}}
{{#if:{{{suppress sources|}}}||
== Sources of {{#lvar:name}} ==
{{Condition sources|{{#lvar:name}}}}
}}
<!--some housekeeping:categories and cargo-->{{Main namespace only|[[Category:Conditions]]}}{{#switch: {{{this is an example|}}}
| yes =
| #default = {{#cargo_store: _table = conditions
| name = {{#lvar:name}}
| icon = {{#lvar:icon}}
| types = {{#lvar:type}}
}}
}}</includeonly><noinclude>{{documentation|content=
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.


If a condition has multiple types, separate them with a semicolon.
<h2> Grants: </h2>


<pre>
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
{{Condition Page
{{#invoke: ParseList | main | {{{grants}}} | type = htmlListNoBullets | useTemplate = SAI/fixed }}
| effects =
</div>
| type =
| honour mode =
| status groups =
| tick type =  
| properties =  
| stack type =
| notes =
}}
</pre>


Examples:
}}{{#if: {{{condition|}}} |


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


{{ConditionPage
<div class="bg3wiki-tooltip-box bg3wiki-tooltip-gradient-common">
| name = Blade Ward
{{Condition | {{{condition}}}
| effects =
| save = {{{condition save|}}}
* Has [[resistance]] against {{DamageType|Bludgeoning}}, {{DamageType|Piercing}}, and {{DamageType|Slashing}} damage dealt by weapon attacks. Damage of these types is halved.
| dc = {{{condition dc|}}}
| this is an example = yes
| duration = {{{condition duration|}}}
| honour mode = * If you get hit by anything you are not resistant too, you immediately die.
| type = Cursed, Prone
| status groups = SG_RemoveOnRespec
| tick type = end
| stack id = BLADE_WARD
| stack type = ignore
| properties = FreezeDuration, IgnoreResting, InitiateCombat, ApplyToDead
| notes = * note 1
* note 2
}}
}}
{{main namespace only|{{Inflicts|{{{condition}}}|cond}}}}
</div>


== Bone Chilled (Condition) ==
}}{{#if: {{{condition2|}}} | {{blank}}


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


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


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


== Multiple types example ==
== Sources of {{#lvar:name}} ==


{{ConditionPage
{{Condition sources | {{#lvar:page}} }}
| name = Absolutely Ruined
| icon = Generic Death Icon.webp
| effects =
* How are you still alive?
* {{Disadvantage}} on [[Ability Check]]s and {{SavingThrow}}s using Charisma.
* Vulnerable to all damage.
| type = diseased, cursed,incapacitated, prone, charmed
| this is an example = yes
| suppress sources = true
}}
}}
 
<!--some housekeeping:categories and cargo-->{{Main namespace only|[[Category:Conditions]]{{#cargo_store: _table = conditions
[[Category:Page generating templates]][[Category:Condition templates]]
| name = {{#lvar:name}}
 
| icon = {{#lvar:icon}}
{{#cargo_declare: _table = conditions
| 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",
"suggestedvalues": [
"Cursed",
"Diseased",
"Poisoned",
"Polymorphed",
"Charmed",
"Frightened",
"Incapacitated",
"Prone",
"Unconscious",
"Blinded",
"Maimed"
]
},
"status groups": {
"description": "Any status groups the condition belongs too. If multiple, separate the types with commas.",
"type": "string",
"example": "mad, invisible, helpable condition, light, weapon coating, "
},
"tick type": {
"description": "When the condition loses duration. This can be at the start or end of a turn. If marked with '''none''' the condition will be marked as not having a duration. This may be used by conditions who are active based on something else like a passive feature or standing near something.",
"type": "string",
"suggestedvalues": [
            "start",
            "end",
            "none"
            ]
},
"properties": {
"description": "Properties for the condition. If multiple, separate the types with commas.",
"type": "string",
            "example": "FreezeDuration, IgnoreResting, InitiateCombat, ApplyToDead"
},
"stack type": {
"description": "Decides what happends when the condition is applied while already being present. '''additive''' adds the durations together, '''overwrite''' replaces the present condition and duration with the new, and '''ignore''' will keep the present condition and duration. This can be important on conditions who have the same stack ID as other conditions to show which of them takes priority, and for showing if you can increase the duration of a condition by applying it again.",
"type": "string",
"suggestedvalues": [
            "additive",
            "overwrite",
            "ignore"
            ]
},
"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