Template:AfflictionParser/doc: Difference between revisions
From Official Barotrauma Wiki
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
{|class="wikitable sortable" style="width: 100%;" | {|class="wikitable sortable" style="width: 100%;" | ||
!Field!!Note!!Example | !Field!!Note!!Example!!Default | ||
|- | |- | ||
| afflictions || Afflictions | | afflictions || Afflictions separated by <code>;</code><br>Values separated by <code>,</code>. | ||
|| | || | ||
burn | burn = 10;<br> | ||
burn | burn = 20, chance = 0.5; <br> | ||
|- | |- | ||
| projectiles || | | projectiles || Projectiles. | ||
* Not displayed if not defined or equal to 1. | |||
|| 8 || 1 | |||
|- | |- | ||
| weapondamagemodifier || | | weapondamagemodifier || Weapon Damage Modifier. | ||
* Not displayed if not defined or equal to 1. | |||
|| 1.1 || 1 | |||
|- | |- | ||
|} | |} | ||
== Supported Values == | |||
{|class="wikitable sortable" style="width: 100%;" | |||
!Field!!Note!!Example!!Default | |||
|- | |||
| duration, durationfail || Duration of the entire Status Effect can be set by defining "duration" or "durationfail" before Afflictions. || duration = 10, failduration = 15; | |||
|- | |||
| identifier = strength || Identifier of the affliction, followed by it's strength. || burn = 20 | |||
* It must be the first value of an affliction. | |||
* If the value in XML is inside a "ReduceAffliction" element, negate the value. | |||
|- | |||
| fail = number || Strength of an affliction when failed || fail = 10 | |||
|- | |||
| chance = number || Probability of an affliction to occur. || chance = 0.2 | |||
|- | |||
| duration = number || Duration of an affliction, only define if different from Status Effect duration. || duration = 5 | |||
|- | |||
| delay = number || Delay before the affliction starts to have an effect. || delay = 3 | |||
|- | |||
| instant = yes || Can be used to make an affliction ignore duration if needed. || instant = yes | |||
|} | |||
=Sub Templates= | =Sub Templates= |
Revision as of 16:32, 14 April 2023
Main article: Template:Items infobox
WORK IN PROGRESS
Template that will hopefully replace the current way afflictions are inserted into the Template:Items Infobox and how they are displayed there and in all other templates that display afflictions.
Instructions
Field | Note | Example | Default |
---|---|---|---|
afflictions | Afflictions separated by ; Values separated by , .
|
burn = 10; | |
projectiles | Projectiles.
|
8 | 1 |
weapondamagemodifier | Weapon Damage Modifier.
|
1.1 | 1 |
Supported Values
Field | Note | Example | Default |
---|---|---|---|
duration, durationfail | Duration of the entire Status Effect can be set by defining "duration" or "durationfail" before Afflictions. | duration = 10, failduration = 15; | |
identifier = strength | Identifier of the affliction, followed by it's strength. | burn = 20
| |
fail = number | Strength of an affliction when failed | fail = 10 | |
chance = number | Probability of an affliction to occur. | chance = 0.2 | |
duration = number | Duration of an affliction, only define if different from Status Effect duration. | duration = 5 | |
delay = number | Delay before the affliction starts to have an effect. | delay = 3 | |
instant = yes | Can be used to make an affliction ignore duration if needed. | instant = yes |
Sub Templates
Template in use
Simulations of how this would work when displayd in table cells in the infobox or table templates.
Test 1
{{AfflictionDisplayTest|afflictions = burn = 10; burn = 20, chance = 0.5; burn = 30; burn = 40, chance = 0.01; burn = 50;
Table Cell |
---|
Test 2
{{AfflictionDisplayTest|afflictions = explosiondamage = 100; burn = 100; bleeding = 50; stun = 5; }} <div style="text-align:center">Explosion (5m):</div> {{AfflictionDisplayTest|afflictions = explosiondamage = 200; burn = 200; bleeding = 40, chance = 0.05; stun = 10; radiationsickness = 30;
Table Cell |
---|
Template:AfflictionDisplayTest Explosion (5m):
|
Test 3
{{AfflictionDisplayTest|afflictions = duration = 11, durationfail = 9; burn = 10, chance = 0.5, fail = 5, duration = 15, delay = 3, instant = yes; }}
Table Cell |
---|
Test 4
{{AfflictionDisplayTest|medicalafflictions = duration = 11, durationfail = 9; burn = 10, fail = 5, delay = 3; lacerations = 15, fail = 10, duration = 6; bitewounds = 25, fail = 20, instant=yes; }}
Table Cell |
---|
Test 5
{{AfflictionDisplayTest|medicalafflictions = duration = 11; burn, 10, delay = 3; lacerations, 15, duration = 6; bitewounds, 25, instant=yes; }}
Table Cell |
---|
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.