Template:AfflictionParser
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 | |
---|---|
The above documentation is transcluded from Template:AfflictionParser/doc. (edit | history)