Template:AfflictionParser/doc: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
mNo edit summary
mNo edit summary
Line 279: Line 279:
<pre style="width:50em>
<pre style="width:50em>
{{AfflictionDisplayTest|medicalafflictions = duration = 20, durationfail = 10;
{{AfflictionDisplayTest|medicalafflictions = duration = 20, durationfail = 10;
organdamage = 10, fail = 10, note = Only affects [[Mudraptor]]s;
organdamage = 10, fail = 10, note = Only&nbsp;affects&nbsp;[[Mudraptor]]s;
nausea = 5;
nausea = 5;
</pre>
</pre>

Revision as of 11:17, 15 April 2023

Documentation
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.

Sub Templates

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, medicalafflictions, resistances Afflictions separated by ;
Values separated by ,.
  • medicalafflictions allows the Fail column to apprear if any affliction had fail defined, or durationfail is defined.

afflictions =
burn = 10;
burn = 20, chance = 0.5;

medicalafflictions = duration = 10;
damage = -5, fail = -2.5;
burn = -0.1, fail = -0.05;
oxygenlow = 2, fail = 3;

resistances =
burn = 0.5, chance = 0.4;
lacerations = 0.6;
bitewounds = 0.7;

projectiles Projectiles.
  • Not displayed if not defined or equal to 1.
8 1
weapondamagemodifier Weapon Damage Modifier.
  • Not displayed if not defined or equal to 1.
1.1 1
protects Protected limbs
  • Afflictions are displayed as resistances if defined.
Head
noresistancenames Resistances are displayed without names if defined as yes. yes

Supported Values for afflictions, medicalafflictions, resistances

Field Note Example Default
duration, durationfail Duration of the entire Status Effect can be set by defining "duration" or "durationfail" before Afflictions.
  • Must be defined before any afflictions are.
duration = 10, failduration = 15;
identifier = strength Identifier of the affliction, followed by it's strength.
In case of resistances, Identifier of the affliction, followed by it's resistance.
  • It must be the first value of an affliction.
  • If the value in XML is inside a "ReduceAffliction" element, negate the value.
burn = 20
fail = number Strength of an affliction when failed fail = 10
chance = number Probability of an affliction to occur.
  • if Protects is defined, 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

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

Template:AfflictionDisplayTest



40mm Mini Nuke

Main article: 40mm Mini Nuke


{{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):

Template:AfflictionDisplayTest


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|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

Template:AfflictionDisplayTest



Diving Suit no names

Main article: Diving Suit


{{AfflictionDisplayTest|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

Template:AfflictionDisplayTest



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

This is the documentation page, it should be transcluded into the main template page. See Template:Doc for more information.