Template:Infobox crop: Difference between revisions
Appearance
Initial StepHarvest theme setup |
Drop internal id, clarify instant sell section, fix stray empty paragraphs |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<includeonly><templatestyles src="Infobox crop/styles.css" /><div class="sh-infobox"> | <includeonly><templatestyles src="Infobox crop/styles.css" /><div class="sh-infobox"><!-- | ||
<div class="sh-infobox-title">{{{name|{{PAGENAME}}}}}</div> | --><div class="sh-infobox-title">{{{name|{{PAGENAME}}}}}{{#if:{{{special|}}}| ★|}}</div><!-- | ||
{{#ifexist:File:{{{image|{{PAGENAME}}}}}.png|<div class="sh-infobox-image">[[File:{{{image|{{PAGENAME}}}}}.png|96px|alt={{{name|{{PAGENAME}}}}}]]</div>|}}<div class="sh-infobox-rows"> | -->{{#ifexist:File:{{{image|{{PAGENAME}}}}}.png|<div class="sh-infobox-image">[[File:{{{image|{{PAGENAME}}}}}.png|96px|alt={{{name|{{PAGENAME}}}}}]]</div>|}}<!-- | ||
<div class="sh-infobox-section">Growing</div> | -->{{#if:{{{description|}}}|<div class="sh-infobox-desc">{{{description}}}</div>|}}<!-- | ||
{{#if:{{{seed|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Seed</div><div class="sh-infobox-value">{{{seed}}}</div></div>|}} | --><div class="sh-infobox-rows"><!-- | ||
{{#if:{{{seasons|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Season</div><div class="sh-infobox-value">{{#invoke:StepHarvest|seasons|{{{seasons}}}}}</div></div>|}} | --><div class="sh-infobox-section">Growing</div><!-- | ||
{{#if:{{{growth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Growth</div><div class="sh-infobox-value">{{{growth_days}}} {{#ifeq:{{{growth_days}}}|1|day|days}}</div></div>|}} | -->{{#if:{{{seed|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Seed</div><div class="sh-infobox-value">{{{seed}}}</div></div>|}}<!-- | ||
{{#if:{{{regrowth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Regrowth</div><div class="sh-infobox-value">every {{{regrowth_days}}} {{#ifeq:{{{regrowth_days}}}|1|day|days}}</div></div>|}} | -->{{#if:{{{seasons|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Season</div><div class="sh-infobox-value">{{#invoke:StepHarvest|seasons|{{{seasons}}}}}</div></div>|}}<!-- | ||
{{#if:{{{ | -->{{#if:{{{growth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Growth</div><div class="sh-infobox-value">{{{growth_days}}} {{#ifeq:{{{growth_days}}}|1|day|days}}</div></div>|}}<!-- | ||
{{#if:{{{ | -->{{#if:{{{regrowth_days|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Regrowth</div><div class="sh-infobox-value">every {{{regrowth_days}}} {{#ifeq:{{{regrowth_days}}}|1|day|days}}</div></div>|}}<!-- | ||
{{#if:{{{sell_price|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label"> | -->{{#if:{{{trellis|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Grows on</div><div class="sh-infobox-value">Trellis</div></div>|}}<!-- | ||
-->{{#if:{{{step_cost_plant|}}}|<div class="sh-infobox-row"><div class="sh-infobox-label">Planting</div><div class="sh-infobox-value">{{Steps|{{{step_cost_plant}}}}}</div></div>|}}<!-- | |||
-->{{#if:{{{sell_price|}}}|<div class="sh-infobox-section">Selling</div><div class="sh-infobox-row"><div class="sh-infobox-label">Base value</div><div class="sh-infobox-value">{{Gold|{{{sell_price}}}}}</div></div><div class="sh-infobox-section">Instant sell to store</div><div class="sh-infobox-row"><div class="sh-infobox-label">{{Quality|regular}}</div><div class="sh-infobox-value">{{Gold|{{#invoke:StepHarvest|storePayout|{{{sell_price}}}|regular}}}}</div></div><div class="sh-infobox-row"><div class="sh-infobox-label">{{Quality|silver}}</div><div class="sh-infobox-value">{{Gold|{{#invoke:StepHarvest|storePayout|{{{sell_price}}}|silver}}}}</div></div><div class="sh-infobox-row"><div class="sh-infobox-label">{{Quality|gold}}</div><div class="sh-infobox-value">{{Gold|{{#invoke:StepHarvest|storePayout|{{{sell_price}}}|gold}}}}</div></div><div class="sh-infobox-row"><div class="sh-infobox-label">{{Quality|pristine}}</div><div class="sh-infobox-value">{{Gold|{{#invoke:StepHarvest|storePayout|{{{sell_price}}}|pristine}}}}</div></div><div class="sh-infobox-note">The store pays 60 percent of base value, scaled by quality. Player listings on the [[Marketplace]] are separate.</div>|}}<!-- | |||
--></div><!-- | |||
--></div>{{#cargo_store:_table=crops}}</includeonly><noinclude> | |||
</div> | |||
</div>{{#cargo_store:_table=crops}}</includeonly><noinclude> | |||
{{#cargo_declare:_table=crops | {{#cargo_declare:_table=crops | ||
|name=String | |name=String | ||
|seed= | |seed=Wikitext | ||
|seasons=List (,) of String | |seasons=List (,) of String | ||
|growth_days=Integer | |growth_days=Integer | ||
| Line 25: | Line 22: | ||
|step_cost_plant=Integer | |step_cost_plant=Integer | ||
|sell_price=Integer | |sell_price=Integer | ||
| | |description=Text | ||
| | |trellis=Boolean | ||
| | |special=Boolean | ||
}} | }} | ||
Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live. | Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live. | ||
| Line 36: | Line 33: | ||
<pre> | <pre> | ||
{{Infobox crop | {{Infobox crop | ||
|name=Parsnip | |name=Parsnip | ||
|image=Parsnip | |image=Parsnip | ||
|seed=Parsnip Seeds | |seed={{ItemLink|Parsnip Seeds|icon=Parsnip seeds}} | ||
|seasons=spring | |seasons=spring | ||
|growth_days= | |growth_days=2 | ||
|regrowth_days= | |regrowth_days= | ||
|step_cost_plant= | |step_cost_plant=35 | ||
|sell_price= | |sell_price=55 | ||
| | |description=A humble root vegetable. Quick and reliable. | ||
| | |trellis= | ||
| | |special= | ||
}} | }} | ||
</pre> | </pre> | ||
* <code>sell_price</code> is the raw base value from the game data. Per quality store payouts are computed by [[Module:StepHarvest]] from the universal quality multipliers, never enter them by hand. | |||
* <code>image</code> defaults to the page name, and the image row only renders when the file exists. | * <code>image</code> defaults to the page name, and the image row only renders when the file exists. | ||
* <code>seasons</code> takes a comma separated list, for example <code>spring, fall</code>. | * <code>seasons</code> takes a comma separated list, for example <code>spring, fall</code>. | ||
* <code>trellis</code> and <code>special</code> are flags: pass <code>yes</code> or leave empty. | |||
* Leave any unknown parameter empty and its row is hidden. | * Leave any unknown parameter empty and its row is hidden. | ||
[[Category:Infobox templates]] | [[Category:Infobox templates]] | ||
</noinclude> | </noinclude> | ||
Latest revision as of 18:41, 11 June 2026
This template defines the table "crops". View table. Infobox for crop pages. Parameter names map 1:1 to the game's data fields so a future bulk sync from the game database stays mechanical. All balance numbers belong in these parameters, not in prose, since values are tuned live.
Data is also stored in the Cargo table crops, so listing pages ("all spring crops") can be queries instead of hand maintained tables.
Usage
{{Infobox crop
|name=Parsnip
|image=Parsnip
|seed={{ItemLink|Parsnip Seeds|icon=Parsnip seeds}}
|seasons=spring
|growth_days=2
|regrowth_days=
|step_cost_plant=35
|sell_price=55
|description=A humble root vegetable. Quick and reliable.
|trellis=
|special=
}}
sell_priceis the raw base value from the game data. Per quality store payouts are computed by Module:StepHarvest from the universal quality multipliers, never enter them by hand.imagedefaults to the page name, and the image row only renders when the file exists.seasonstakes a comma separated list, for examplespring, fall.trellisandspecialare flags: passyesor leave empty.- Leave any unknown parameter empty and its row is hidden.