Template:Food: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(preserved into uses object id instead of page name for clarity) |
||
(44 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= | 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}} | ||
[[Category:Cargo Store Templates]] | [[Category:Cargo Store Templates]] | ||
{{doc}} | {{doc}} | ||
</noinclude><includeonly>{{#cargo_store:_table=Food | |||
</noinclude><includeonly>{{#cargo_store:_table=Food| | |Title={{{title|}}} | ||
Title={{{title|}}}| | |RenderString={{{renderstr|}}} | ||
RenderString={{{renderstr|}}}| | |ColorString={{{colorstr|&y}}} | ||
ColorString={{{colorstr|&y}}}| | |ObjectID={{{id|}}} | ||
ObjectID={{{id|}}}| | |LightRadius={{{lightradius|}}} | ||
LightRadius={{{lightradius|}}}| | |Hunger={{{hunger|}}} | ||
Hunger={{{hunger|}}}| | |Thirst={{{thirst|}}} | ||
Thirst={{{thirst|}}}| | |Extra={{#if: {{{extra|}}}|{{{extra}}}}} | ||
Extra={{#if: {{{extra|}}}|{{{extra}}}}}| | |Description={{qud text|{{{desc|}}}}} | ||
Description={{qud text|{{{desc|}}}}}| | |Healing={{{healing|}}} | ||
Healing={{{healing|}}}| | |HarvestedInto={{{harvestedinto|}}} | ||
HarvestedInto={{{harvestedinto|}}}| | |PreservedInto={{{preservedinto|}}} | ||
PreservedInto={{{preservedinto|}}}| | |PreservedQuantity={{{preservedquantity|}}} | ||
PreservedQuantity={{{preservedquantity|}}}| | |ExoticFood={{{exoticfood|no}}} | ||
ExoticFood={{{exoticfood|no}}}| | |FoodContains={{#if:{{#ifeq:{{{ismeat|}}}|yes|yes}}{{#ifeq:{{{isplant|}}}|yes|yes}}{{#ifeq:{{{isfungus|}}}|yes|yes}}|{{#ifeq:{{{ismeat|}}}| yes | | ||
FoodContains={{#if:{{#ifeq:{{{ismeat|}}}|yes|yes}}{{#ifeq:{{{isplant|}}}|yes|yes}}{{#ifeq:{{{isfungus|}}}|yes|yes}}|{{#ifeq:{{{ismeat|}}}| yes | | |||
Meat }}{{#ifeq:{{{isplant|}}}| yes | | Meat }}{{#ifeq:{{{isplant|}}}| yes | | ||
Plants }}{{#ifeq:{{{isfungus|}}}| yes | | Plants }}{{#ifeq:{{{isfungus|}}}| yes | | ||
Fungi }}|none}}| | Fungi }}|none}} | ||
OnEat={{#if: {{{illoneat|}}} |Become ill</br>}}{{{oneat|}}}| | |OnEat={{#if: {{{illoneat|}}} |Become ill</br>}}{{{oneat|}}} | ||
CookEffect={{{cookeffect|}}}}}<!-- | |CookEffect={{#if: {{{cookeffect|}}}|{{consecutive templates|{{{cookeffect}}}|,|;|||CookEffect ID to name}} }} | ||
|JoinKey={{FULLPAGENAME}} }}<!-- | |||
GeneralData Cargo Store Begin | GeneralData Cargo Store Begin | ||
-->{{#cargo_store:_table=GeneralData|ObjectID={{{id|}}}| | -->{{#cargo_store:_table=GeneralData | ||
DisplayName={{{title|{{PAGENAME}}}}}| | |ObjectID={{{id|}}} | ||
Image={{#ifeq: {{{image|}}} | none ||{{{image|}}}}}| | |DisplayName={{{title|{{PAGENAME}}}}} | ||
DisplayChar={{qud char|{{{colorstr|&y}}}|{{{renderstr|}}}}}| | |Image={{#ifeq: {{{image|}}} | none ||{{{image|}}}}} | ||
PlainName={{#titleparts:{{PAGENAME}}}}| | |DisplayChar={{qud char|{{{colorstr|&y}}}|{{{renderstr|}}}}} | ||
Commerce={{{commerce|}}}| | |PlainName={{StripFormatting|1={{{title|{{#titleparts:{{PAGENAME}}}} }}} }} | ||
Weight={{{weight|}}}| | |Commerce={{{commerce|}}} | ||
Tier={{{tier|}}}| | |Weight={{{weight|}}} | ||
ParentObject={{{inheritingfrom|}}} }}<!-- | |Tier={{{tier|}}} | ||
|Categories={{{categories|}}} | |||
|ParentObject={{{inheritingfrom|}}} | |||
|JoinKey={{FULLPAGENAME}} | |||
|Description={{{desc|}}} }}<!-- | |||
Variable Definitions | Variable Definitions | ||
-->{{#vardefine:name|{{{title|{{PAGENAME}}}}}}}<!-- | -->{{#vardefine:name|{{{title|{{PAGENAME}}}}}}}{{#vardefine:id|{{{id|}}}}}<!-- | ||
Infobox UI Begin | Infobox UI Begin | ||
Line 54: | Line 58: | ||
{{#if: {{{renderstr|}}}| {{infobox row|Character|{{Qud text|{{{colorstr|&y}}}{{{renderstr}}}}} }} }} | {{#if: {{{renderstr|}}}| {{infobox row|Character|{{Qud text|{{{colorstr|&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|{{{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 63: | 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| | {{#if: {{{preservedinto|}}}| {{infobox row|Preserved into|{{favilink id|{{{preservedinto}}} }} x{{{preservedquantity|1}}} }} }} | ||
{{#ifeq: {{#vardefineecho:Infobox_PreservedFrom | |||
|{{#invoke:CargoQuery| main | |||
| table=Food | |||
| fields=ObjectID=Page | |||
| where=PreservedInto = "{{#var:id}}" | |||
| template=favilink id | |||
| delimiter=</br> | |||
| default=None}}}}| None || {{infobox row|Preserved from|{{#var:Infobox_PreservedFrom}} }} }} | |||
{{#ifeq: {{#vardefineecho:Infobox_ButcheredFrom | |||
|{{#invoke:CargoQuery| main | |||
| table=CorpseTables=CT | |||
| fields=MainObjectID=id, Weight=weight | |||
| where=ObjectID="{{{id|}}}" | |||
| template=Drop rate query | |||
| default=None | |||
| delimiter=</br>}}}}| None || {{infobox row|Butchered from|{{#var:Infobox_ButcheredFrom}} }} }} | |||
{{#ifeq: {{#vardefineecho:Infobox_HarvestedFrom | |||
|{{#invoke:CargoQuery| compound | |||
| 1=tables=ItemsTable=IT, GeneralData=GD | |||
; join on=IT.ObjectID=GD.ObjectID | |||
; fields={{favilink format args}} | |||
; where= HarvestedInto= "{{{id|{{#var:id}}}}}" | |||
| 2 = table=Characters=C, GeneralData=GD | |||
; join on=C.ObjectID = GD.ObjectID | |||
;fields={{favilink format args}} | |||
; 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>}}{{{oneat|}}} }} }} | {{#if: {{{oneat|}}}{{{illoneat|}}} | {{infobox row|On Eat|{{#if: {{{illoneat|}}}|<p>Become [[ill]]</p>}}{{#if: {{{oneat|}}}|{{{oneat|}}} }} }} }} | ||
{{#if: {{{cookeffect|}}} | {{Infobox row|Cooking Effect|{{{cookeffect}}}}} }} | {{#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|}}}|{{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 |{{{eatdesc}}} | {{#if: {{{eatdesc|}}} | {{Qud quote notxml|{{{eatdesc}}}|upon consuming }} }}{{#if:{{{categories|}}}|[[Category:{{{categories}}}]] }} | ||
</includeonly> | </includeonly> |
Latest revision as of 00:43, 25 July 2023
This template defines the table "Food". View table. This template adds rows to the table "GeneralData", which is declared by the template General data table. View table.
Parameter | Explanation | Data type |
---|---|---|
title | The display name of the item. | {{Qud text|(title)}} |
image | The image. If the item has no associate sprite, set equal to none. | item name.png/none |
weight | int | |
commerce | The value of the object | int |
colorstr | the color of the character with tiles mode off. | &(char),defaults to &y |
renderstr | What the item looks like with tiles mode off. | char |
id | The name of the object in ObjectBlueprints.xml | string |
lightradius | radius of light it gives off | int |
hunger | how much hunger it satiates | String |
thirst | how much thirst it slakes | int |
healing | what the item heals | string |
preservedinto | what the item preserves into | string |
preservedquantity | how much of the preserved item is made | integer |
exoticfood | is it exotic? (must choose to preserve) | yes/no |
oneat | effects that happen when you eat. | string |
cookeffect | the cooking effect type. should be the type= part in part Name PreparedCookingIngredient. | string |
isplant | has the Plant part | yes/no |
ismeat | has the Meat part | yes/no |
isfungus | has the fungus part | yes/no |
extra | Any other features that do not have an associated variable. | string |
desc | The short description of the object. | The whole string, with color codes included |
eatdesc | the description upon eating | string |
{{Food
| title = {{Qud text|&mtaco suprema}}
| image = taco suprema.png
| weight = 0
| commerce = 500
| renderstr = %
| id = Taco Suprema
| hunger = Meal
| thirst = 15000
| desc = A delicious taco, wrapped in thin paper.
| eatdesc = Usted ama el tacos!}}
taco suprema
A delicious taco, wrapped in thin paper.
Usted ama el tacos!
— upon consuming |