Template:AfflictionParser/doc: Difference between revisions
m (update) |
mNo edit summary |
||
(9 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
=Sub Templates= | =Sub Templates= | ||
*[[Template: | *[[Template:AfflictionParser/Affliction]] | ||
= Template Instructions = | = Template Instructions = | ||
Line 82: | Line 82: | ||
| failnote = "text" || Note displayed above afflictions in the fail column. | | failnote = "text" || Note displayed above afflictions in the fail column. | ||
* Text must be within quotation marks <code>" "</code> | * Text must be within quotation marks <code>" "</code> | ||
| <code> | | <code>failnote = "text"</code> | ||
|- | |- | ||
| note = "text" || Note displayed above afflictions. | | note = "text" || Note displayed above afflictions. | ||
Line 104: | Line 104: | ||
| chance = number || Probability of an affliction to occur.<br>In case of resistances, probability to completely resist an affliction. || <code>chance = 0.2</code> | | chance = number || Probability of an affliction to occur.<br>In case of resistances, probability to completely resist an affliction. || <code>chance = 0.2</code> | ||
|- | |- | ||
| duration = number || Duration of an affliction, only define if different from Status Effect duration. || <code>duration = 5</code> | | duration = number || Duration of an affliction, only define if different from Status Effect duration. || <code>duration = 10</code> | ||
|- | |||
| durationfail = number || Duration of an affliction when failed, only define if different from Status Effect duration. || <code>duration = 5</code> | |||
|- | |- | ||
| delay = number || Delay before the affliction starts to have an effect. || <code>delay = 3</code> | | delay = number || Delay before the affliction starts to have an effect. || <code>delay = 3</code> | ||
|- | |||
| delayfail = number || Delay before the affliction starts to have an effect when failed. || <code>delay = 5</code> | |||
|- | |- | ||
| instant = yes || Can be used to make an affliction ignore duration if needed. || <code>instant = yes</code> | | instant = yes || Can be used to make an affliction ignore duration if needed. || <code>instant = yes</code> | ||
Line 134: | Line 138: | ||
== Test 1 == | == Test 1 == | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|afflictions = | ||
burn = 10; | burn = 10; | ||
burn = 20, chance = 0.5; | burn = 20, chance = 0.5; | ||
Line 146: | Line 150: | ||
|- | |- | ||
| | | | ||
{{ | {{AfflictionParser|afflictions = | ||
burn = 10; | burn = 10; | ||
burn = 20, chance = 0.5; | burn = 20, chance = 0.5; | ||
Line 162: | Line 166: | ||
{{main|40mm Mini Nuke}} | {{main|40mm Mini Nuke}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|afflictions = | ||
explosiondamage = 100; | explosiondamage = 100; | ||
burn = 100; | burn = 100; | ||
Line 181: | Line 185: | ||
|- | |- | ||
| | | | ||
{{ | {{AfflictionParser|afflictions = | ||
explosiondamage = 100; | explosiondamage = 100; | ||
burn = 100; | burn = 100; | ||
Line 203: | Line 207: | ||
{{main|Ethanol}} | {{main|Ethanol}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 10; | ||
psychosisresistance = 600, instant = yes; | psychosisresistance = 600, instant = yes; | ||
drunk = 2, delay = 10; | drunk = 2, delay = 10; | ||
Line 215: | Line 219: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 10; | ||
psychosisresistance = 600, instant = yes; | psychosisresistance = 600, instant = yes; | ||
drunk = 2, delay = 10; | drunk = 2, delay = 10; | ||
Line 230: | Line 234: | ||
{{main|Morphine}} | {{main|Morphine}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 10; | ||
damage = -5, fail = -2.5; | damage = -5, fail = -2.5; | ||
burn = -0.1, fail = -0.05; | burn = -0.1, fail = -0.05; | ||
Line 243: | Line 247: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 10; | ||
damage = -5, fail = -2.5; | damage = -5, fail = -2.5; | ||
burn = -0.1, fail = -0.05; | burn = -0.1, fail = -0.05; | ||
Line 260: | Line 264: | ||
{{main|Diving Suit}} | {{main|Diving Suit}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|protects = Head|resistances = | ||
bitewounds = 0.7; | bitewounds = 0.7; | ||
lacerations = 0.7; | lacerations = 0.7; | ||
Line 271: | Line 275: | ||
}} | }} | ||
</pre> | </pre> | ||
<div style="width:45%;> | |||
{| | {| | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
| | | | ||
{{ | {{AfflictionParser|protects = Head|resistances = | ||
bitewounds = 0.7; | bitewounds = 0.7; | ||
lacerations = 0.7; | lacerations = 0.7; | ||
Line 287: | Line 291: | ||
}} | }} | ||
|} | |} | ||
<div> | |||
{{clr}} | {{clr}} | ||
Line 295: | Line 299: | ||
{{main|Diving Suit}} | {{main|Diving Suit}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|protects = Head|noresistancenames = yes|resistances = | ||
bitewounds = 0.7; | bitewounds = 0.7; | ||
lacerations = 0.7; | lacerations = 0.7; | ||
Line 311: | Line 315: | ||
|- | |- | ||
| | | | ||
{{ | {{AfflictionParser|protects = Head|noresistancenames = yes|resistances = | ||
bitewounds = 0.7; | bitewounds = 0.7; | ||
lacerations = 0.7; | lacerations = 0.7; | ||
Line 330: | Line 334: | ||
{{main|Raptor Bane Extract}} | {{main|Raptor Bane Extract}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 20, durationfail = 10; | ||
organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; | organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; | ||
nausea = 5; | nausea = 5; | ||
Line 338: | Line 342: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 20, durationfail = 10; | ||
organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; | organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; | ||
nausea = 5; | nausea = 5; | ||
Line 351: | Line 355: | ||
{{main|Endocrine Booster}} | {{main|Endocrine Booster}} | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = note = "Grants the user a new talent, provided there's one available to recieve." | ||
</pre> | </pre> | ||
Line 357: | Line 361: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = note = "Grants the user a new talent, provided there's one available to recieve." | ||
}} | }} | ||
|} | |} | ||
Line 368: | Line 372: | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|weapondamagemodifier = 1.3| afflictions = | ||
gunshotwound = 15; | gunshotwound = 15; | ||
bleeding = 5; | bleeding = 5; | ||
Line 380: | Line 384: | ||
|- | |- | ||
| | | | ||
{{ | {{AfflictionParser|weapondamagemodifier = 1.3| afflictions = | ||
gunshotwound = 15; | gunshotwound = 15; | ||
bleeding = 5; | bleeding = 5; | ||
Line 395: | Line 399: | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = successnote = "Success Status Effect Note", failnote = "Fail Status Effect Note"; | ||
burn = 40, fail = 45, successnote = "Success note 1"; | burn = 40, fail = 45, successnote = "Success note 1"; | ||
burn = 50, fail = 55, failnote = "Fail note 1"; | burn = 50, fail = 55, failnote = "Fail note 1"; | ||
Line 405: | Line 409: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = successnote = "Success Status Effect Note", failnote = "Fail Status Effect Note"; | ||
burn = 40, fail = 45, successnote = "Success note 1"; | burn = 40, fail = 45, successnote = "Success note 1"; | ||
burn = 50, fail = 55, failnote = "Fail note 1"; | burn = 50, fail = 55, failnote = "Fail note 1"; | ||
Line 420: | Line 424: | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = consumptiontime = 25; | ||
psychosisresistance = 20; | psychosisresistance = 20; | ||
psychosis = -6; | psychosis = -6; | ||
Line 432: | Line 436: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = consumptiontime = 25; | ||
psychosisresistance = 20; | psychosisresistance = 20; | ||
psychosis = -6; | psychosis = -6; | ||
Line 448: | Line 452: | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; | ||
bleeding = -100, fail = -75; | bleeding = -100, fail = -75; | ||
burn = -100, fail = -75; | burn = -100, fail = -75; | ||
Line 458: | Line 462: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; | ||
bleeding = -100, fail = -75; | bleeding = -100, fail = -75; | ||
burn = -100, fail = -75; | burn = -100, fail = -75; | ||
Line 471: | Line 475: | ||
<pre style="width:fit-content> | <pre style="width:fit-content> | ||
{{ | {{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; | ||
bleeding = -100, fail = -75; | bleeding = -100, fail = -75; | ||
burn = -100, fail = -75; | burn = -100, fail = -75; | ||
Line 481: | Line 485: | ||
! Table Cell | ! Table Cell | ||
|- | |- | ||
{{ | {{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; | ||
bleeding = -100, fail = -75; | bleeding = -100, fail = -75; | ||
burn = -100, fail = -75; | burn = -100, fail = -75; | ||
Line 492: | Line 496: | ||
---- | ---- | ||
<pre style="width:fit-content> | |||
{{AfflictionParser|medicalafflictions = duration = 60; | |||
oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; | |||
organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; | |||
}} | |||
</pre> | |||
{| | |||
! Table Cell | |||
|- | |||
{{AfflictionParser|medicalafflictions = duration = 60; | |||
oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; | |||
organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; | |||
}} | |||
|} | |||
{{clr}} | |||
---- | |||
<pre style="width:fit-content> | |||
{{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 60; | |||
oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; | |||
organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; | |||
}} | |||
</pre> | |||
{| | |||
! Table Cell | |||
|- | |||
{{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 60; | |||
oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; | |||
organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; | |||
}} | |||
|} | |||
{{clr}} | |||
---- | |||
{{doc/end}} | {{doc/end}} |
Latest revision as of 17:33, 26 December 2023
Template that replaces the old format of how afflictions were written in the Template:Items Infobox and how they are displayed there and in all other templates that display afflictions.
Previously each affliction and it's parameters had to have their own field in cargo like "burn, burnchance, burn2, burn2chance, explosionburn, explosionburnchance, explosionburn2, explosionburn2chance" & every template displaying them had to query and use all of them in a massive wall of copypasta that was modified for every exception in every table template and infobox, don't even get me started on Template:MedicalTable/row, after seeing that I immidiately gave up trying to do anything there and made this entire template instead.
This template will be used to display afflictions in all templates that do so, instead of having to copypasta the entire afflictions thing into every template. This means changes to this template will automatically affect everywhere afflictions are displayed on the wiki.
Afflictions names are found using Template:FindNameById, which finds the name of the matching identifier from the Special:CargoTables/Afflictions cargo table. This means all afflictions that have a page are by default supported by this template.
Additionally "poison" and "damage" affliction identifiers link to "Poison (Affliction Type)" and "Damage (Affliction Type)" respectively. Adding more exceptions like these is very simple.
Sub Templates
Template Instructions
Affliction values are written and stored in cargo on each page with one of the infoboxes. The template can then use the stored values to display the afflictions and their associated info. Other parameters can be used to apply Projectiles or Weapon Damage Modifier, or to customize how the afflictions are shown.
Field | Note | Example | Default |
---|---|---|---|
afflictions explosionafflictions medicalafflictions resistances |
Afflictions are separated by ; Affliction Parameters are separated by ,
|
afflictions = | |
projectiles | Projectiles.
|
8 | 1 |
weapondamagemodifier | Weapon Damage Modifier.
|
1.1 | 1 |
protects | Protected limbs
|
Head | |
noresistancenames | Resistances are displayed without names if defined as yes . |
yes | |
hidecalculations | Moves the visible affliction calculations (Projectiles x Strength x Weapon Damage Modifier) to the tooltip. | yes | |
compactmedical | Displays success and fail in the same column | yes | |
durationcolumn | Displays the duration in a second column instead of under the afflictions. Intended to be used together with compactmedical | yes |
Affliction Instructions
Field | Note | Example | Default |
---|---|---|---|
Status Effect Parameters (Must be defined before any afflictions. They affect all Afflictions. Separated by , )
| |||
duration = number | Duration of the entire Status Effect. | duration = 10
| |
durationfail = number | Overrides duration for afflictions in the fail column. |
failduration = 15
| |
successnote = "text" | Note displayed above afflictions in the success column.
|
successnote = "text"
| |
failnote = "text" | Note displayed above afflictions in the fail column.
|
failnote = "text"
| |
note = "text" | Note displayed above afflictions.
|
note = "text"
| |
consumptiontime = number | Time it takes to fully consume the item | consumptiontime = 25
| |
Affliction Parameters (Separated by , )
| |||
identifier = strength | Identifier of the affliction, followed by it's strength. In case of resistances, Identifier of the affliction, followed by it's resistance multiplier.
|
burn = 20 burn = 0.75 burn = -30
| |
fail = number | Strength of an affliction when failed | fail = 10
| |
chance = number | Probability of an affliction to occur. In case of resistances, probability to completely resist an affliction. |
chance = 0.2
| |
duration = number | Duration of an affliction, only define if different from Status Effect duration. | duration = 10
| |
durationfail = number | Duration of an affliction when failed, only define if different from Status Effect duration. | duration = 5
| |
delay = number | Delay before the affliction starts to have an effect. | delay = 3
| |
delayfail = number | Delay before the affliction starts to have an effect when failed. | delay = 5
| |
instant = yes | Can be used to make an affliction ignore duration if needed. | instant = yes
| |
successnote = "text" | Note displayed under the affliction stats in the success column.
|
successnote = "text"
| |
failnote = "text" | Note displayed under the affliction stats in the fail column.
|
failnote = "text"
| |
note = "text" | Note displayed under the affliction stats.
|
note = "text"
|
Template in use
Simulations of how this would work when displayed in table cells in the infobox or table templates.
Test 1
{{AfflictionParser|afflictions = burn = 10; burn = 20, chance = 0.5; burn = 30; burn = 40, chance = 0.01; burn = 50;
Table Cell |
---|
40mm Mini Nuke
Main article: 40mm Mini Nuke
{{AfflictionParser|afflictions = explosiondamage = 100; burn = 100; bleeding = 50; stun = 5; explosionafflictions = explosiondamage = 200; burn = 200; bleeding = 40, chance = 0.05; stun = 10; radiationsickness = 30; }}
Table Cell |
---|
Deep Tissue Injury (100)* Burn (100)* Bleeding (50)* Stun (5)* Explosion (m): Deep Tissue Injury (200)* Burn (200)* Bleeding (40)* (5% chance) Stun (10)* Radiation Sickness (30)* |
Ethanol
Main article: Ethanol
{{AfflictionParser|medicalafflictions = duration = 10; psychosisresistance = 600, instant = yes; drunk = 2, delay = 10; hallucinating = -2, delay = 10; psychosis = -2, delay = 10; }}
Table Cell |
---|
Psychosis Resistance (600)* Drunk (20)* (10s delay) Hallucinating (-20)* (10s delay) Psychosis (-20)* (10s delay) |
Morphine
Main article: Morphine
{{AfflictionParser|medicalafflictions = duration = 10; damage = -5, fail = -2.5; burn = -0.1, fail = -0.05; oxygenlow = 2, fail = 3; opiateaddiction = 0.5, fail = 2.5; opiatewithdrawal = -3, fail = -3; opiateoverdose = 1, fail = 2; }}
Table Cell | |
---|---|
Success: Damage (Affliction Type) (-50)* Burn (-1)* Oxygen Low (20)* Opiate Addiction (5)* Opiate Withdrawal (-30)* Opiate Overdose (10)* |
Failure: Damage (Affliction Type) (-25)* Burn (-0.5)* Oxygen Low (30)* Opiate Addiction (25)* Opiate Withdrawal (-30)* Opiate Overdose (20)* |
Diving Suit
Main article: Diving Suit
{{AfflictionParser|protects = Head|resistances = bitewounds = 0.7; lacerations = 0.7; blunttrauma = 0.7; gunshotwound = 0.7; burn = 0.75; bleeding = 0.7; huskinfection = 1, chance = 0.5; radiationsickness = 0.75; }}
Table Cell |
---|
Bite Wounds (30%)* Lacerations (30%)* Blunt Force Trauma (30%)* Gunshot Wound (30%)* Burn (25%)* Bleeding (30%)* Husk Infection (0% | 50%)* Radiation Sickness (25%)* |
Diving Suit no names
Main article: Diving Suit
{{AfflictionParser|protects = Head|noresistancenames = yes|resistances = bitewounds = 0.7; lacerations = 0.7; blunttrauma = 0.7; gunshotwound = 0.7; burn = 0.75; bleeding = 0.7; huskinfection = 1, chance = 0.5; radiationsickness = 0.75; }}
Table Cell |
---|
Raptor Bane Extract
Main article: Raptor Bane Extract
{{AfflictionParser|medicalafflictions = duration = 20, durationfail = 10; organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; nausea = 5;
Table Cell | |
---|---|
Success:
|
Failure: |
Endocrine Booster
Main article: Endocrine Booster
{{AfflictionParser|medicalafflictions = note = "Grants the user a new talent, provided there's one available to recieve."
Table Cell |
---|
Grants the user a new talent, provided there's one available to recieve. |
Test
{{AfflictionParser|weapondamagemodifier = 1.3| afflictions = gunshotwound = 15; bleeding = 5; radiationsickness = 10; stun = 0.15; }}
Table Cell |
---|
|
Test
{{AfflictionParser|medicalafflictions = successnote = "Success Status Effect Note", failnote = "Fail Status Effect Note"; burn = 40, fail = 45, successnote = "Success note 1"; burn = 50, fail = 55, failnote = "Fail note 1"; burn = 60, fail = 65, successnote = "Success note 2", failnote = "Fail note 2"; }}
Table Cell | |
---|---|
Success:
|
Failure:
|
Cigar
Main article: Cigar
{{AfflictionParser|medicalafflictions = consumptiontime = 25; psychosisresistance = 20; psychosis = -6; reaperstax = -1; hallucinating = -10; watchersgaze = -5; }}
Table Cell |
---|
Psychosis Resistance (20/s)* Psychosis (-6/s)* Reaper's Tax (-1/s)* Hallucinating (-10/s)* Watcher's Gaze (-5/s)* |
Test
{{AfflictionParser|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; bleeding = -100, fail = -75; burn = -100, fail = -75; organdamage = 0, fail = 1.25, duration = 5; }}
Table Cell | |
---|---|
Success:
|
Failure:
|
{{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 1, note = "Only affects the targeted limb"; bleeding = -100, fail = -75; burn = -100, fail = -75; organdamage = 0, fail = 1.25, duration = 5; }}
Table Cell | |
---|---|
{{AfflictionParser|medicalafflictions = duration = 60; oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; }}
Table Cell | |
---|---|
Success:
|
Failure:
|
{{AfflictionParser|durationcolumn=yes|compactmedical=yes|medicalafflictions = duration = 60; oxygenlow = 2.5, duration = 60, delay = 1, fail = 2.5, durationfail = 10, delayfail = 5; organdamage = 1.5, duration = 5, fail = 1.5, durationfail = 10; }}
Table Cell | |
---|---|
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.