Template:Medical infobox: Difference between revisions

From Official Barotrauma Wiki
Jump to: navigation, search
m (I wonder if i can change the table schema without admin rights...)
(WIP)
Line 1: Line 1:
<noinclude>
<noinclude>
==cargo test==
{{clr}}
Looks like we need the [https://www.mediawiki.org/wiki/Extension:Page_Forms Page Forms] extension to edit DB without admin rights. Creating it still requires admin?


{{#cargo_declare:_table=Medical_Items
{{doc}}
|Item=String
 
|Afflictions=String
{{#cargo_declare:_table=Items
|Duration=Integer
| identifier = String
|Skill=Integer
| name = String
|random_field=Integer}}
| icon = File
</noinclude>
| sprite = File
<includeonly>
| type = String
{{#cargo_store:_table=Medical_Items
<!-- damage -->
|Item=Bandage
| internaldamage = Integer
|Afflictions={{str|Bleeding|-24|-18}}<br>{{str|Burn|-18|-12}}
| bluntforcetrauma = Float
|Duration=12
| deeptissueinjury = Float
|Skill=10 }}<!--
| lacerations = Float
{|
| gunshotwound = Float
! Item !! Afflictions !! Duration !! Skill
| organdamage = Integer
| burn = Float
| bleeding = Float
| stun = Float
| oxygenlow = Integer
| huskinfection = Integer
| morbusinepoisoning = Integer
| sufforinpoisoning = Integer
| deliriuminepoisoning = Integer
| cyanidepoisoning = Integer
| radiationsickness = Integer
| paralysis = Integer
| progressivestun = Float
<!-- store -->
| baseprice = Integer
| outpostmultiplier = Float
| citymultiplier = Float
| researchmultiplier = Float
| militarymultiplier = Float
| minemultiplier = Float
| outpostsold = Boolean
| citysold = Boolean
| researchsold = Boolean
| militarysold = Boolean
| minesold = Boolean
| outpostminavailable = Integer
| cityminavailable = Integer
| researchminavailable = Integer
| militaryminavailable = Integer
| mineminavailable = Integer
<!-- crafting -->
| fabricator = Boolean
| deconstructor = Boolean
| medicalfabricator = Boolean
| talent = String
| fabricatormaterials = Wikitext
| deconstructormaterials = Wikitext
| fabricatortime = Integer
| deconstructortime = Integer
| fabricatorskill = String
| fabricatorskilllevel = Integer
| fabricatorskill2 = String
| fabricatorskilllevel2 = Integer
| fabricatormaterialsalt = Wikitext
| fabricatorskilllevelalt = Integer
| fabricatortimealt = Integer
| fabricatedamount = Integer
}}
 
</noinclude><includeonly>
{| class="infobox responsive-table" align=right
! class="infobox2 responsive-table" colspan="3" | {{{name|{{PAGENAME}}}}}
|-
|-
| item1 || affli1 || duration1 || skill1
| colspan="3" style="padding:0.5em;text-align:center !important;" | {{ImageHandler
| file  = {{#if: {{{icon|}}} | {{{icon}}} | {{PAGENAME}}.png }}
| imagewidth  = {{#if: {{{iconwidth|}}} | {{{iconwidth}}}px |}}
}}
{{#if: {{{maxstack|}}}|<span style="text-align:right;">{{{maxstack}}}</span>|}}<!--
 
-->{{#if: {{{caption|}}} |<div style="margin:auto;text-align:center;max-width:450px;word-wrap: break-word;"><small>{{{caption}}}</small></div>}}{{#if: {{{sprite|}}} |<br><br>[[File:{{{sprite|}}}|{{{spritewidth|64}}}px]]
{{#if: {{{caption2|}}} |<br><small>{{{caption2}}}</small>}}
|}}
|-<!--
 
-->
| style="text-align:center;" colspan="3"  | {{#switch: {{{type}}} |equipment=[[:Category:Medical Equipment|Medical Equipment]]|basic=[[:Category:Basic Chemicals|Basic Chemical]]|medicine=[[:Category:Medicines|Medicine]]|stimulant=[[:Category:Stimulants|Stimulant]]|poison=[[:Category:Poisons|Poison]]|antidote=[[:Category:Antidotes|Antidote]]|#default=[[:Category:Medical Items|Medical Item]]}}{{#if: {{{talent|}}}|, [[:Category:Talent Items|Talent Item]]|}}
|-<!--
 
-->
! class="infobox3 responsive-table" colspan="3" | Afflictions
|-<!--
 
-->
| style="width:40%;font-size:105%;" | Desirable '''[[Skills#Medical|Medical Skill]]'''
| style="width:60%;text-align:center;" colspan="2" | {{#if: {{{useskill|}}}|{{{useskill}}}|None}}
|-<!--
 
-->
{{#if: {{{useskill|}}}|{{!}} style="width:50%;" colspan="2" {{!}} Success
{{!}} style="width:50%;" {{!}} Failure
{{!}}-
|}}<!--
 
-->
|{{#if: {{{useskill|}}}| style="width:50%;" colspan="2" {{!}}|}}<div style="inline-size:min-content; margin:auto; white-space:nowrap;"><!--
 
###########################
 
-->{{#if: {{{bluntforcetrauma|}}}|{{Affliction|Blunt Force Trauma|||{{{bluntforcetrauma}}}}}<br>|}}<!--
-->{{#if: {{{lacerations|}}}|{{Affliction|Lacerations|||{{{lacerations}}}}}<br>|}}<!--
-->{{#if: {{{gunshotwound|}}}|{{Affliction|Gunshot Wound|||{{{gunshotwound}}}}}<br>|}}<!--
-->{{#if: {{{deeptissueinjury|}}}|{{Affliction|Deep Tissue Injury|||{{{deeptissueinjury}}}}}<br>|}}<!--
-->{{#if: {{{organdamage|}}}|{{Affliction|Organ Damage|||{{{organdamage}}}}}<br>|}}<!--
-->{{#if: {{{burn|}}}|{{Affliction|Burn|||{{{burn}}}}}<br>|}}<!--
-->{{#if: {{{bleeding|}}}|{{Affliction|Bleeding|||{{{bleeding}}}}}<br>|}}<!--
-->{{#if: {{{oxygenlow|}}}|{{Affliction|Oxygen Low|||{{{oxygenlow}}}}}<br>|}}<!--
-->{{#if: {{{huskinfection|}}}|{{Affliction|Husk Infection|||{{{huskinfection}}}}}<br>|}}<!--
-->{{#if: {{{morbusinepoisoning|}}}|{{Affliction|Morbusine Poisoning|||{{{morbusinepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{sufforinpoisoning|}}}|{{Affliction|Sufforin Poisoning|||{{{sufforinpoisoning}}}}}<br>|}}<!--
-->{{#if: {{{deliriuminepoisoning|}}}|{{Affliction|Deliriumine Poisoning|||{{{deliriuminepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{cyanidepoisoning|}}}|{{Affliction|Cyanide Poisoning|||{{{cyanidepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{radiationsickness|}}}|{{Affliction|Radiation Sickness|||{{{radiationsickness}}}}}<br>|}}<!--
-->{{#if: {{{paralysis|}}}|{{Affliction|Paralysis|||{{{paralysis}}}}}<br>|}}<!--
-->{{#if: {{{progressivestun|}}}|{{Affliction|Progressive Stun|||{{{progressivestun}}}}}<br>|}}<!--
-->{{#if: {{{stun|}}}|{{Affliction|Stun|||{{{stun}}}s}}|}}<!--
--></div><!--
 
-->
{{#if: {{{useskill|}}}|{{!}} style="width:50%;" {{!}}<div style="inline-size:min-content; margin:auto; white-space:nowrap;"><!--
 
###########################
 
-->{{#if: {{{bluntforcetrauma|}}}|{{Affliction|Blunt Force Trauma|||{{{bluntforcetrauma}}}}}<br>|}}<!--
-->{{#if: {{{lacerations|}}}|{{Affliction|Lacerations|||{{{lacerations}}}}}<br>|}}<!--
-->{{#if: {{{gunshotwound|}}}|{{Affliction|Gunshot Wound|||{{{gunshotwound}}}}}<br>|}}<!--
-->{{#if: {{{deeptissueinjury|}}}|{{Affliction|Deep Tissue Injury|||{{{deeptissueinjury}}}}}<br>|}}<!--
-->{{#if: {{{organdamage|}}}|{{Affliction|Organ Damage|||{{{organdamage}}}}}<br>|}}<!--
-->{{#if: {{{burn|}}}|{{Affliction|Burn|||{{{burn}}}}}<br>|}}<!--
-->{{#if: {{{bleeding|}}}|{{Affliction|Bleeding|||{{{bleeding}}}}}<br>|}}<!--
-->{{#if: {{{oxygenlow|}}}|{{Affliction|Oxygen Low|||{{{oxygenlow}}}}}<br>|}}<!--
-->{{#if: {{{huskinfection|}}}|{{Affliction|Husk Infection|||{{{huskinfection}}}}}<br>|}}<!--
-->{{#if: {{{morbusinepoisoning|}}}|{{Affliction|Morbusine Poisoning|||{{{morbusinepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{sufforinpoisoning|}}}|{{Affliction|Sufforin Poisoning|||{{{sufforinpoisoning}}}}}<br>|}}<!--
-->{{#if: {{{deliriuminepoisoning|}}}|{{Affliction|Deliriumine Poisoning|||{{{deliriuminepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{cyanidepoisoning|}}}|{{Affliction|Cyanide Poisoning|||{{{cyanidepoisoning}}}}}<br>|}}<!--
-->{{#if: {{{radiationsickness|}}}|{{Affliction|Radiation Sickness|||{{{radiationsickness}}}}}<br>|}}<!--
-->{{#if: {{{paralysis|}}}|{{Affliction|Paralysis|||{{{paralysis}}}}}<br>|}}<!--
-->{{#if: {{{progressivestun|}}}|{{Affliction|Progressive Stun|||{{{progressivestun}}}}}<br>|}}<!--
-->{{#if: {{{stun|}}}|{{Affliction|Stun|||{{{stun}}}s}}|}}<!--
--></div>|}}<!--
 
--------------------------------------------------------------------------- CRAFTING
-->
|-
|-
| item2 || affli2 || duration2 || skill2
! class="infobox3 responsive-table" colspan="3" {{!}} [[Medical Fabricator|Crafting]]
|}-->
{{#if: {{#ifeq: {{lc:{{{medicalfabricator|}}}}} | yes | yes |}} {{{fabricatormaterials|}}} | | <!--
{|
-->{{!}}-
! Item
{{!}} style="width:40%;font-size:105%;" {{!}} Constructible?
| {{{Item|}}}
{{!}} style="width:60%;text-align:center;" colspan="2" {{!}} No}}
|-
|-<!--
! Afflictions
 
| {{{Afflictions|}}}
-->
|-
{{#if:{{{talent|}}}|
! Duration
{{!}} style="width:40%;font-size:105%;" {{!}} Required [[Talent]]
| {{{Duration|}}}
{{!}} style="width:60%;text-align:center;" colspan="2" {{!}} {{{talent}}}
|-
{{!}}-
! Skill
|}}<!--
| {{{Skill|}}}
 
|}
-->
{{#if:{{{fabricatorskill|}}}|
{{!}}-
{{!}} style="width:40%;font-size:105%;" {{!}} <abbr title="Below this medical skill level, fabrication will take longer depending on level gap">Fabricator Skill</abbr>
{{!}} style="width:60%;text-align:center;" colspan="2" {{!}} [[Skills#Medical|Medical]]<!--
-->{{space}}{{{fabricatorskill}}}
|}}<!--
 
-->
{{#if:{{{fabricatormaterials|}}}|
{{!}}-
{{!}} style="width:40%;font-size:105%;" {{!}} {{#ifeq:{{lc:{{{fabricator|}}}}}|yes|[[Fabricator]] '''or'''<br>[[Medical Fabricator]]<br>Requirements|[[Medical Fabricator]]<br>Requirements}}{{#if: {{{fabricatedamount|}}}|<br>(produces {{{fabricatedamount}}} items)|}}
{{!}} style="width:60%;" colspan="2" {{!}} <div style="inline-size:min-content; margin:auto; white-space:nowrap;">{{{fabricatormaterials}}}<br>[[File:time.png]] {{{fabricatortime|N/A}}}s</div>
}}<!--
 
-->
{{#if: {{#ifeq: {{lc:{{{deconstructor|}}}}} | yes | yes |}} {{{deconstructormaterials|}}} | | <!--
-->{{!}}-
{{!}} style="width:40%;font-size:105%;" {{!}} Deconstructible?
{{!}} style="width:60%;text-align:center;" colspan="2" {{!}} No}}
|-<!--
 
-->
{{#if: {{{deconstructormaterials|}}}|
{{!}}-
{{!}} style="width:40%;font-size:105%;" {{!}} [[Deconstructor]] Yield
{{!}} style="width:60%;" colspan="2" {{!}} <div style="inline-size:min-content; margin:auto; white-space:nowrap;">{{{deconstructormaterials}}}<br>[[File:time.png]] {{{deconstructortime|N/A}}}s</div>
|}}<!--
--------------------------------------------------------------------------- STORE
// Display prices using multipliers
// Only shows prices at 0 RP
// item price = location multiplier*base price of item
// item sell price = location multiplier*base price of item*0.8 (80% of buy price)
 
-->
{{!}}-
{{#if: {{{nostore|}}}||
{{#if: {{{baseprice|}}}|
! class="infobox3 responsive-table" colspan="{{#if: {{{unbuyable|}}}|2|3}}" {{!}} [[Store]]
{{!}}-
{{!}} style="width:{{#if: {{{unbuyable|}}}|5|4}}0%;font-size:105%;" {{!}} [[File:Outpost.png|32px|Outpost|link=Campaign#Location]][[Campaign#Location|Outpost]]
{{#if: {{{unbuyable|}}} | | {{!}} style="width:30%;font-size:105%;text-align:center;vertical-align:middle;" {{!}} Buy }}
{{!}} style="width:{{#if: {{{unbuyable|}}}|5|3}}0%;font-size:105%;text-align:center;vertical-align:middle;" {{!}} Sell
{{!}}-
{{!}} style="height:0;padding:0;" colspan="{{#if: {{{unbuyable|}}}|2|3}}" {{!}} <div style="margin: 0 auto;width:95%;float:center;border-bottom: 1px #E2D9A4 dotted;"></div>
{{!}}-
{{#if:{{{outpostmultiplier|}}}|{{Items_infobox/store|outpost|{{{baseprice}}}|{{{outpostmultiplier}}}|{{#if: {{{unbuyable|}}}|all|{{{outpostunbuyable|{{#ifeq:{{{outpostsold}}}|no|true|}}}}} }} }}
{{!}}-
|}}
{{#if:{{{citymultiplier|}}}|{{Items_infobox/store|city|{{{baseprice}}}|{{{citymultiplier}}}|{{#if: {{{unbuyable|}}}|all|{{{cityunbuyable|{{#ifeq:{{{citysold}}}|no|true|}}}}} }} }}
{{!}}-
|}}
{{#if:{{{researchmultiplier|}}}|{{Items_infobox/store|research|{{{baseprice}}}|{{{researchmultiplier}}}|{{#if: {{{unbuyable|}}}|all|{{{researchunbuyable|{{#ifeq:{{{researchsold}}}|no|true|}}}}} }}  }}
{{!}}-
|}}
{{#if:{{{militarymultiplier|}}}|{{Items_infobox/store|military|{{{baseprice}}}|{{{militarymultiplier}}}|{{#if: {{{unbuyable|}}}|all|{{{militaryunbuyable|{{#ifeq:{{{militarysold}}}|no|true|}}}}} }} }}
{{!}}-
|}}
{{#if:{{{minemultiplier|}}}|{{Items_infobox/store|mine|{{{baseprice}}}|{{{minemultiplier}}}|{{#if: {{{unbuyable|}}}|all|{{{mineunbuyable|{{#ifeq:{{{minesold}}}|no|true|}}}}} }} }}
|}}|}}}}
|}<!--
--------------------------------------------------------------------------- CATEGORIES
-->{{#if: {{{nocat|}}} | |[[Category:{{#switch: {{{type}}}|equipment=Medical Equipment|basic=Basic Chemicals|medicine=Medicines|stimulant=Stimulants|poison=Poisons|antidote=Antidotes|#default=Items Needing Categorization}}]][[Category:Small Items]]{{#if: {{{talent|}}}|[[Category:Talent Items]]|}}{{#if: {{{medicalfabricator|}}}|[[Category:Medical Fabricator Items]][[Category:Craftable Items]]|[[Category:Non-Craftable Items]]}}{{#if: {{{fabricatormaterials|}}}|[[Category:Fabricator Items]][[Category:Craftable Items]]|}}{{#if: {{{deconstructormaterials|}}}|[[Category:Deconstructible Items]]|[[Category:Non-Deconstructible Items]]}}[[Category:Items]]}}<!--
 
-->{{#if: {{{nocat|}}} | |<!--
--------------------------------------------------------------------------- MAIN CARGO STORAGE
-->{{#cargo_store:_table=Medical_Items
| identifier = {{{identifier|}}}
| name = {{{name|{{PAGENAME}}}}}
| icon = {{#if:{{{icon|}}}|{{{icon}}}|{{{name|{{PAGENAME}}}}}.png}}
| sprite = {{#if:{{{sprite|}}}|{{{sprite}}}|{{{name|{{PAGENAME}}}}}_sprite.png}}
| type = {{{type|}}}
<!-- damage -->
| damage = {{{damage|}}}
| damagefail = {{{damagefail|}}}
| psychosis = {{{psychosis|}}}
| psychosisfail = {{{psychosisfail|}}}
| opiateaddiction = {{{opiateaddiction|}}}
| opiateaddictionfail = {{{opiateaddictionfail|}}}
| opiateoverdose = {{{opiateoverdose|}}}
| opiateoverdosefail = {{{opiateoverdosefail|}}}
| opiatewithdrawal = {{{opiatewithdrawal|}}}
| opiatewithdrawalfail = {{{opiatewithdrawalfail|}}}
| drunk = {{{drunk|}}}
| drunkfail = {{{drunkfail|}}}
| nausea = {{{nausea|}}}
| nauseafail = {{{nauseafail|}}}
| hallucinating = {{{hallucinating|}}}
| hallucinatingfail = {{{hallucinatingfail|}}}
| deliriuminepoisoning = {{{deliriuminepoisoning|}}}
| deliriuminepoisoningfail = {{{deliriuminepoisoningfail|}}}
| sufforinpoisoning = {{{sufforinpoisoning|}}}
| sufforinpoisoningfail = {{{sufforinpoisoningfail|}}}
| morbusinepoisoning = {{{morbusinepoisoning|}}}
| morbusinepoisoningfail = {{{morbusinepoisoningfail|}}}
| cyanidepoisoning = {{{cyanidepoisoning|}}}
| cyanidepoisoningfail = {{{cyanidepoisoningfail|}}}
| bloodloss = {{{bloodloss|}}}
| bloodlossfail = {{{bloodlossfail|}}}
| slowmetabolism = {{{slowmetabolism|}}}
| slowmetabolismfail = {{{slowmetabolismfail|}}}
| huskinfectionresistance = {{{huskinfectionresistance|}}}
| huskinfectionresistancefail = {{{huskinfectionresistancefail|}}}
| psychosisresistance = {{{psychosisresistance|}}}
| psychosisresistancefail = {{{psychosisresistancefail|}}}
| haste = {{{haste|}}}
| hastefail = {{{hastefail|}}}
| vigor = {{{vigor|}}}
| vigorfail = {{{vigorfail|}}}
| pressurestabilized = {{{pressurestabilized|}}}
| pressurestabilizedfail = {{{pressurestabilizedfail|}}}
| combatstimulant = {{{combatstimulant|}}}
| combatstimulantfail = {{{combatstimulantfail|}}}
| chemaddiction = {{{chemaddiction|}}}
| chemaddictionfail = {{{chemaddictionfail|}}}
| paralysisresistance = {{{paralysisresistance|}}}
| paralysisresistancefail = {{{paralysisresistancefail|}}}
| paralysisresistanceduration = {{{paralysisresistanceduration|}}}<!-- para resist is the only buff with a specific duration on failure (anaparalyzant) -->
| incrementalstun = {{{incrementalstun|}}}
| incrementalstunfail = {{{incrementalstunfail|}}}<!-- doesn't exist -->
| organdamage = {{{organdamage|}}}
| organdamagefail = {{{organdamagefail|}}}
| burn = {{{burn|}}}
| burnfail = {{{burnfail|}}}
| bleeding = {{{bleeding|}}}
| bleedingfail = {{{bleedingfail|}}}
| stun = {{{stun|}}}
| stunfail = {{{stunfail|}}}
| oxygenlow = {{{oxygenlow|}}}
| oxygenlowfail = {{{oxygenlowfail|}}}
| huskinfection = {{{huskinfection|}}}
| huskinfectionfail = {{{huskinfectionfail|}}}
| radiationsickness = {{{radiationsickness|}}}
| radiationsicknessfail = {{{radiationsicknessfail|}}}
| paralysis = {{{paralysis|}}}
| paralysisfail = {{{paralysisfail|}}}
<!-- store -->
| baseprice = {{{baseprice|}}}
| outpostmultiplier = {{{outpostmultiplier|}}}
| outpostsold = {{#ifeq:{{{unbuyable|}}}|true|no|{{#if:{{{outpostunbuyable|}}}|{{#switch:{{{outpostunbuyable|}}}|true|all = no|#default = yes}}|{{{outpostsold|yes}}}}}}}
| outpostminavailable = {{{outpostminavailable|}}}
| citymultiplier = {{{citymultiplier|}}}
| citysold = {{#ifeq:{{{unbuyable|}}}|true|no|{{#if:{{{cityunbuyable|}}}|{{#switch:{{{cityunbuyable|}}}|true|all = no|#default = yes}}|{{{citysold|yes}}}}}}}
| cityminavailable = {{{cityminavailable|}}}
| researchmultiplier = {{{researchmultiplier|}}}
| researchsold = {{#ifeq:{{{unbuyable|}}}|true|no|{{#if:{{{researchunbuyable|}}}|{{#switch:{{{researchunbuyable|}}}|true|all = no|#default = yes}}|{{{researchsold|yes}}}}}}}
| researchminavailable = {{{researchminavailable|}}}
| militarymultiplier = {{{militarymultiplier|}}}
| militarysold = {{#ifeq:{{{unbuyable|}}}|true|no|{{#if:{{{militaryunbuyable|}}}|{{#switch:{{{militaryunbuyable|}}}|true|all = no|#default = yes}}|{{{militarysold|yes}}}}}}}
| militaryminavailable = {{{militaryminavailable|}}}
| minemultiplier = {{{minemultiplier|}}}
| minesold = {{#ifeq:{{{unbuyable|}}}|true|no|{{#if:{{{mineunbuyable|}}}|{{#switch:{{{mineunbuyable|}}}|true|all = no|#default = yes}}|{{{minesold|yes}}}}}}}
| mineminavailable = {{{mineminavailable|}}}
<!-- crafting -->
| fabricator = {{{fabricator|}}}
| deconstructor = {{{deconstructor|}}}
| medicalfabricator = {{{medicalfabricator|}}}
| talent = {{{talent|}}}
| fabricatormaterials = {{{fabricatormaterials|}}}
| deconstructormaterials = {{{deconstructormaterials|}}}
| fabricatortime = {{{fabricatortime|}}}
| deconstructortime = {{{deconstructortime|}}}
| fabricatorskill = {{{fabricatorskill|}}}
| fabricatorskilllevel = {{{fabricatorskilllevel|}}}
| fabricatorskill2 = {{{fabricatorskill2|}}}
| fabricatorskilllevel2 = {{{fabricatorskilllevel2|}}}
| fabricatedamount = {{{fabricatedamount|}}}
}}}}
</includeonly>
</includeonly>

Revision as of 05:22, 19 November 2021

Template:Medical infobox/doc

This template defines the table "Items". View table.