Template:AfflictionParser/doc: Difference between revisions
mNo edit summary |
(More info about the general use of the template and what it's meant to do.) |
||
Line 1: | Line 1: | ||
{{doc/start}}{{main|Template:Items infobox}} | {{doc/start}}{{main|Template:Items infobox}} | ||
WORK IN PROGRESS | WORK IN PROGRESS (Pretty much complete at this point) | ||
Template that | |||
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. | |||
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. | |||
__TOC__ | __TOC__ |
Revision as of 22:26, 3 May 2023
WORK IN PROGRESS (Pretty much complete at this point)
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.
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
All of these values should be taken from cargo. Writing them manually is possible but there is no reason to.
Field | Note | Example | Default |
---|---|---|---|
afflictions explosionafflictions medicalafflictions resistancemultipliers |
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 | |
totaldamage | Calculates the total damage of combat afflictions instead of displaying them. | 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.
|
failsnote = "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 = 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
| |
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
{{AfflictionDisplayTest|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
{{AfflictionDisplayTest|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 |
---|
Ethanol
Main article: Ethanol
{{AfflictionDisplayTest| medicalafflictions = duration = 10; psychosisresistance = 600, instant = yes; drunk = 2, delay = 10; hallucinating = -2, delay = 10; psychosis = -2, delay = 10; }}Template:AfflictionDisplayTest
Table Cell |
---|
Morphine
Main article: Morphine
{{AfflictionDisplayTest| 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; }}Template:AfflictionDisplayTest
Table Cell |
---|
Diving Suit
Main article: Diving Suit
{{AfflictionDisplayTest|protects = Head|resistancemultipliers = 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 |
---|
Diving Suit no names
Main article: Diving Suit
{{AfflictionDisplayTest|protects = Head|noresistancenames = yes|resistancemultipliers = 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
{{AfflictionDisplayTest|medicalafflictions = duration = 20, durationfail = 10; organdamage = 10, fail = 10, note = "Only affects [[Mudraptor]]s"; nausea = 5;Template:AfflictionDisplayTest
Table Cell |
---|
Endocrine Booster
Main article: Endocrine Booster
{{AfflictionDisplayTest|medicalafflictions = note = "Grants the user a new talent, provided there's one available to recieve."Template:AfflictionDisplayTest
Table Cell |
---|
Test
{{AfflictionDisplayTest|weapondamagemodifier = 1.3| afflictions = gunshotwound = 15; bleeding = 5; radiationsickness = 10; stun = 0.15; }}
Table Cell |
---|
Test
{{AfflictionDisplayTest|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"; }}Template:AfflictionDisplayTest
Table Cell |
---|
Cigar
Main article: Cigar
{{AfflictionDisplayTest|medicalafflictions = consumptiontime = 25; psychosisresistance = 20; psychosis = -6; reaperstax = -1; hallucinating = -10; watchersgaze = -5; }}Template:AfflictionDisplayTest
Table Cell |
---|
This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.