Template:Food: Difference between revisions

120 bytes added ,  00:43, 25 July 2023
preserved into uses object id instead of page name for clarity
mNo edit summary
(preserved into uses object id instead of page name for clarity)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{#cargo_declare:_table=Food|
{{#cargo_declare:_table=Food|
Title=Wikitext|RenderString=String|ColorString=String|ObjectID=String|LightRadius=Integer|Hunger=String|Thirst=Integer|Extra=Searchtext|Description=Wikitext|Healing=String|PreservedInto=Page|PreservedQuantity=Integer|ExoticFood=Boolean|FoodContains=String|OnEat=Page|CookEffect=List (,) of String|JoinKey=String}}
Title=Wikitext|RenderString=String|ColorString=String|ObjectID=String|LightRadius=Integer|Hunger=String|Thirst=Integer|Extra=Searchtext|Description=Wikitext|Healing=String|PreservedInto=String|PreservedQuantity=Integer|ExoticFood=Boolean|FoodContains=String|OnEat=Page|CookEffect=List (;) of String|JoinKey=String}}
{{#cargo_attach:
{{#cargo_attach:
_table = GeneralData}}
_table = GeneralData}}
Line 26: Line 26:
Fungi }}|none}}
Fungi }}|none}}
|OnEat={{#if: {{{illoneat|}}} |Become ill</br>}}{{{oneat|}}}
|OnEat={{#if: {{{illoneat|}}} |Become ill</br>}}{{{oneat|}}}
|CookEffect={{#if: {{{cookeffect|}}}|{{consecutive templates|{{{cookeffect}}}|,|, |||CookEffect ID to name}} }}
|CookEffect={{#if: {{{cookeffect|}}}|{{consecutive templates|{{{cookeffect}}}|,|;|||CookEffect ID to name}} }}
|JoinKey={{FULLPAGENAME}} }}<!--                           
|JoinKey={{FULLPAGENAME}} }}<!--                           


Line 58: Line 58:
{{#if: {{{renderstr|}}}| {{infobox row|Character|{{Qud text|{{{colorstr|&amp;y}}}{{{renderstr}}}}} }} }}
{{#if: {{{renderstr|}}}| {{infobox row|Character|{{Qud text|{{{colorstr|&amp;y}}}{{{renderstr}}}}} }} }}
<!--This is the name of the object in ObjectBlueprints.xml-->
<!--This is the name of the object in ObjectBlueprints.xml-->
{{#if: {{{id|}}}      | {{infobox row|ID{{Tooltip|Use this ID to [[Wishes|Wish]] for the item}}|{{{id}}} }} }}
{{#if: {{{id|}}}      | {{infobox row|ID{{Tooltip|Use this ID to [[Wishes|Wish]] for the item||nosearch}}|{{{id}}} }} }}
<!--Yes, some food has a light radius-->
<!--Yes, some food has a light radius-->
{{#if: {{{lightradius|}}}| {{infobox row|Light Radius|{{{lightradius}}} }} }}
{{#if: {{{lightradius|}}}| {{infobox row|Light Radius|{{{lightradius}}} }} }}
Line 67: Line 67:
{{#if: {{{healing|}}} | {{infobox row|Healing|{{{healing}}} }} }}
{{#if: {{{healing|}}} | {{infobox row|Healing|{{{healing}}} }} }}
{{#if: {{{butcheredinto|}}}| {{infobox row|Butchered into|{{{butcheredinto}}} }} }}
{{#if: {{{butcheredinto|}}}| {{infobox row|Butchered into|{{{butcheredinto}}} }} }}
{{#if: {{{harvestedinto|}}}| {{infobox row|Harvested into|{{{harvestedinto}}} }} }}
{{#if: {{{harvestedinto|}}}| {{infobox row|Harvested into|{{favilink id|{{{harvestedinto}}}}} }} }}
{{#if: {{{preservedinto|}}}| {{infobox row|Preserved into|{{favilink|{{{preservedinto}}} }} x{{{preservedquantity|1}}} }} }}
{{#if: {{{preservedinto|}}}| {{infobox row|Preserved into|{{favilink id|{{{preservedinto}}} }} x{{{preservedquantity|1}}} }} }}
{{#ifeq: {{#vardefineecho:Infobox_PreservedFrom
{{#ifeq: {{#vardefineecho:Infobox_PreservedFrom
|{{#invoke:CargoQuery| main  
|{{#invoke:CargoQuery| main  
| table=Food  
| table=Food  
| fields=ObjectID=Page
| fields=ObjectID=Page
| where=PreservedInto = "{{BASEPAGENAME}}"  
| where=PreservedInto = "{{#var:id}}"  
| template=favilink id
| template=favilink id
| delimiter=</br>
| delimiter=</br>
Line 79: Line 79:
{{#ifeq: {{#vardefineecho:Infobox_ButcheredFrom
{{#ifeq: {{#vardefineecho:Infobox_ButcheredFrom
|{{#invoke:CargoQuery| main  
|{{#invoke:CargoQuery| main  
| table=CorpseTables  
| table=CorpseTables=CT
| fields=MainObjectID=id, Weight=weight
| fields=MainObjectID=id, Weight=weight
| where=ObjectID="{{{id|}}}"
| where=ObjectID="{{{id|}}}"
Line 87: Line 87:
{{#ifeq: {{#vardefineecho:Infobox_HarvestedFrom
{{#ifeq: {{#vardefineecho:Infobox_HarvestedFrom
|{{#invoke:CargoQuery| compound
|{{#invoke:CargoQuery| compound
| 1=table=ItemsTable
| 1=tables=ItemsTable=IT, GeneralData=GD
; fields=_pageName=Page
; join on=IT.ObjectID=GD.ObjectID
; where= HarvestedInto= "{{BASEPAGENAME}}"
; fields={{favilink format args}}
| 2 = table=Characters
; where= HarvestedInto= "{{{id|{{#var:id}}}}}"
;fields=_pageName=Page
| 2 = table=Characters=C, GeneralData=GD
; where= HarvestedInto= "{{BASEPAGENAME}}"
; join on=C.ObjectID = GD.ObjectID
|template=single query result
;fields={{favilink format args}}
|default=None}}}}| None || {{infobox row|Harvested from|{{favilink page|{{#var:Infobox_HarvestedFrom}}}} }} }}
; where= HarvestedInto= "{{{id|{{#var:id}}}}}"
|template=favilink format
| delimiter = </br>
|default=None}}}}| None || {{infobox row|Harvested from|{{#var:Infobox_HarvestedFrom}} }} }}
{{#if: {{{exoticfood|}}} | {{infobox row|Exotic Food|{{{exoticfood}}} }} }}  
{{#if: {{{exoticfood|}}} | {{infobox row|Exotic Food|{{{exoticfood}}} }} }}  
{{#if: {{{oneat|}}}{{{illoneat|}}} | {{infobox row|On Eat|{{#if: {{{illoneat|}}}|<p>Become [[ill]]</p>}}{{#if: {{{oneat|}}}|{{consecutive links|{{{oneat|}}}}} }} }} }}
{{#if: {{{oneat|}}}{{{illoneat|}}} | {{infobox row|On Eat|{{#if: {{{illoneat|}}}|<p>Become [[ill]]</p>}}{{#if: {{{oneat|}}}|{{{oneat|}}} }} }} }}
{{#if: {{{cookeffect|}}} | {{Infobox row|Cooking Effect|{{consecutive templates|{{{cookeffect}}}|,|, |||CookEffect ID to page}} }} }}
{{#if: {{{cookeffect|}}} | {{Infobox row|Cooking Effect|{{consecutive templates|{{{cookeffect}}}|,|, |||CookEffect ID to page}} }} }}
{{#if: {{{dynamictable|}}} | {{infobox row|Spawns in|{{{dynamictable}}} }} }}
{{#if: {{{dynamictable|}}} | {{infobox row|Spawns in|{{{dynamictable}}} }} }}
{{#if: {{{extra|}}}{{#if: {{{extra|}}}|{{Infobox row|Extra|<p>{{{extra}}}</p>}} }} }}  
{{#if: {{{extra|}}}|{{Infobox row||Extra Info:</br>{{{extra}}} }} }}
}}
}}
{{#if: {{{desc|}}} | {{Qud look |text={{{desc}}}|title={{{title|{{PAGENAME}} }}} }} }}
{{#if: {{{desc|}}} | {{Qud look |text={{{desc}}}|title={{{title|{{PAGENAME}} }}} }} }}
{{#if: {{{eatdesc|}}} | {{Qud quote notxml|{{{eatdesc}}}|upon consuming }} }}{{#if:{{{categories|}}}|[[Category:{{{categories}}}]] }}
{{#if: {{{eatdesc|}}} | {{Qud quote notxml|{{{eatdesc}}}|upon consuming }} }}{{#if:{{{categories|}}}|[[Category:{{{categories}}}]] }}
</includeonly>
</includeonly>